Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #21935

    I’ve been reading around the support forum trying to find someway to password protect pages with dynamic templates. I can set a password on a page when there is no dynamic template applied, but once I apply a dynamic template, the password request goes away. Any idea? Or there a feature I’m missing? Thanks.

    #113633

    Try following – open up wp-contentthemescoronaincludeshelper-templates.php and replace:

    $output.= $content;
    $contact_page_id = avia_get_option('email_page');

    with:

    if ( ! post_password_required() ) {
    $output.= $content;
    }else{
    $output.= get_the_password_form();
    }
    $contact_page_id = avia_get_option('email_page');

    #113634

    Thanks. Tried it and it still does not work. I tried deleting cache, cookies, etc and still no luck. Again, it works fine when set to default page layout, but if I set a dynamic template on the page, here is no password request.

    #113635

    Sorry, any word on this? I’m kind of in a hurry to fix this issue. Thanks for your help!

    #113636

    Hi,

    I tried this code Dude posted a while ago and just like before it worked fine for me when used with password protection http://i.imgur.com/n9LMbPG.png

    The code is here http://www.kriesi.at/support/topic/password-protect-for-dynamic-templates#post-77861 .. You basically have to remove that entire post_page($elements) function which is on lines 560-637 of /includes/helper-templates.php and replace it with the same function that Dude created at the above link (there are two of them there, you need to copy and past the second function.

    Once done, create a Dynamic Template and add it to a POST. Then password protect that post . ***Switch to a differrent browser. And dont be logged in as admin *** if you created the post as an admin and then are surprised you can still see it , that’s the point, you are an admin so you can see it. Try to logout clear cookies or just use Firefox to play visitor and Chrome to play the admin, so then there is no need to log out.

    Thanks,

    Nick

    #113637

    Thanks again, but I don’t need posts password protected, I need pages with dynamic templates password protected. Let me know what I need to do. Thanks again for the input.

    #113638

    Hi websterag,

    I’ve tagged the topic for Kriesi since Peter’s initial code didn’t fix it for you and I’m not sure what else to try on that since the dynamic templates get priority over all other content within the page.

    In the short term you would need to just not use a dynamic template if you need the content password protected.

    Regards,

    Devin

    #113639

    I’ll add to this. I have narrowed down the problem with password protecting pages to the Enfold theme. I turn off all other plugins and tested it against other themes. The page is set to the default template.

    Password protected pages fail when Enfold is enabled. Sadly I can not use this theme if that is the case.

    Is this a planned fix?

    Thank you.

    #113640

    Open up wp-contentthemesenfoldtemplate-builder.php and replace

    $content = apply_filters('the_content', $content);

    with

    $content = apply_filters('the_content', $content);

    if ( post_password_required() )
    {
    $content = get_the_password_form();
    }

    We’ll fix this in the next version.

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

The topic ‘Password Protect Pages with Dynamic Templates’ is closed to new replies.