Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

BUG? "Homepage Template" + Password protection

This topic is resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Alexey
    Participant
    • 5 Topics
    • 16 Posts
    @redirect

    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? 🙂

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

    Alexey
    Participant
    • 5 Topics
    • 16 Posts
    @redirect

    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 🙂

    Alexey
    Participant
    • 5 Topics
    • 16 Posts
    @redirect

    Maybe this is not the best solution, but it works 🙂

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘BUG? "Homepage Template" + Password protection’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site