Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Compatible Plugins › Grimlock › BUG? "Homepage Template" + Password protection
- This topic has 4 replies, 2 voices, and was last updated 6 years, 8 months ago by
Themosaurus.
-
AuthorPosts
-
AlexeyParticipant@redirect
- 5 Topics
- 16 Posts
The template “Homepage Template” does not support page password protection (the standard functional wp). Just nothing happens. I understand that this is because the template itself does not use the function “get_the_content ()”, but can it somehow be fixed? 🙂
July 29, 2018 at 03:16 #1457@themosaurus- 1 Topics
- 1675 Posts
Hi @Alexey!
We are aware of this problem. And you are right it is because there is no real “content” on this kind of page but only widgets.
In our opinion, there are several ways to solve this problem but unfortunately we need some time to be able to solve it in the best way it can be.This plugin can be a solution if you don’t have much content to hide in each widget: https://wordpress.org/plugins/content-protector/
This plugin can also be useful if you want to hide the whole site = https://wordpress.org/plugins/password-protected/
There is a more solid fix but unfortunately it requires development skills : https://digwp.com/2009/08/password-protect-more-than-the_content/We’ll let you know as soon as we have a clean and efficient solution!
Thank you in advance for your patience!Best regards,
July 30, 2018 at 09:53 #1465AlexeyParticipant@redirect- 5 Topics
- 16 Posts
Hi @themosaurus!
Thanks for the answer! I read the article you mentioned and it helped!
I used this code in the “template-homepage.php” template:<?php if ( post_password_required() ) { echo get_the_password_form(); } else { ?> .. your custom php code or whatever .. <?php } ?>
Thus, the template took the following form:
<?php /** * The template for displaying the homepage. * * Template Name: Homepage Template * * @package gwangi */ get_header(); ?> <div id="primary"> <main id="main" class="site-main"> <?php if ( post_password_required() ) { echo get_the_password_form(); } else { ?> <?php /** * Functions hooked into gwangi_homepage action * * @hooked gwangi_grimlock_homepage - 10 */ do_action( 'gwangi_homepage' ); ?> <?php } ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer();
It remains only to stylize the form of entering a password 🙂
July 30, 2018 at 11:44 #1466@themosaurus- 1 Topics
- 1675 Posts
Glad that we could help you find a solution 🙂
Thank you for your feedback and suggestion, this will surely be helpful for us to fix the problem in a future update!
Best regards,
July 30, 2018 at 13:37 #1473 -
AuthorPosts
The topic ‘BUG? "Homepage Template" + Password protection’ is closed to new replies.