Tagged: x
-
AuthorPosts
-
July 22, 2016 at 2:32 pm #1099024
tsjobomParticipantHi,
I’m using wordpress built in password protection for my portfolio index page, but it’s not showing up. If I change the page to use a different layout it starts working again. Any ideas? I do have a custom my_password_form() function in my child theme’s functions.php.July 22, 2016 at 9:14 pm #1099462
RadModeratorHi there,
Thanks for writing in.
How do you protect it through functions.php? Would you mind providing the code? How about using the WordPress’ default password protection, it’s located along with publish button (post visibility).
Thanks!
July 23, 2016 at 3:21 pm #1100064
tsjobomParticipantThis reply has been marked as private.July 23, 2016 at 11:22 pm #1100358
RadModeratorHi there,
Could be that portfolio uses a different template than the standard one.
Would you mind providing your site’s URL, admin and FTP login credentials in private reply?
Thanks!
July 25, 2016 at 12:31 pm #1102209
tsjobomParticipantThis reply has been marked as private.July 27, 2016 at 12:11 am #1104619
LelyModeratorHi There,
Thank you for the credentials. Unfortunately, the default Password protect function is working only for the the_content filter. That is how it works by default on WordPress. Layout Portfolio page is not part of that same with the blog page index. See this article for more discussion and explanation:https://digwp.com/2009/08/password-protect-more-than-the_content/ and this:https://codex.wordpress.org/Content_Visibility
Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
It could be possible by using a 3rd party plugin however we cannot guarantee their compatibility as we do not support 3rd party plugins.
July 27, 2016 at 6:20 pm #1106054
tsjobomParticipantHi, thanks for those links, that helped me figure it out.
For anyone interested, the solution that worked for me was to override /frameworks/views/integrity/template-layout-portfolio.php as follows:<?php get_header(); ?> <div class="x-container max width offset"> <?php if ( !post_password_required() ) { ?> <div class="<?php x_main_content_class(); ?>" role="main"> <?php x_get_view( 'global', '_portfolio' ); ?> </div> <?php get_sidebar(); ?> <?php } else { echo my_password_form(); } ?> </div> <?php get_footer(); ?>July 27, 2016 at 11:00 pm #1106482
LelyModeratorYou’re welcome!
Thank you also for sharing your code.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1099024 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
