-
AuthorPosts
-
May 5, 2015 at 8:40 pm #439985
I have the latest version of wordpress and Enfold. I have a page that uses a custom template (it’s a survey) and we need it to be password protected. I have it marked as password protected within the page but it is not working. Is there some code I need to add to the template .php file to get it to see that it is password protected? It is not a template that was built in Enfold with the template builder.
Thanks for your help!
May 6, 2015 at 6:15 pm #440552Hey cybervise13!
Are you using the_title, the_excerpt, or the_content functions in the template? That is how WordPress changes the content, https://codex.wordpress.org/Using_Password_Protection.
Cheers!
ElliottMay 6, 2015 at 7:10 pm #440581get_header(); if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div class='container'> <main class='template-page content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>> <div id="container" class="one-column"> <div id="content" role="main">
That is what the content is wrapped in. What do I need to get the password protection to work? thanks for helping.
May 6, 2015 at 7:15 pm #440586The title is saying protected but it does not ask for the password to see the content, just goes straight to the content. I have checked this while being logged out and cache cleared to confirm it is not that too.
May 8, 2015 at 3:15 pm #441544Hey!
I think you could achieve it easily with a plugin like:
https://wordpress.org/plugins/smart-passworded-pages/
https://wordpress.org/plugins/password-protected/Best regards,
AndyMay 8, 2015 at 4:59 pm #441642The url used to direct people to this password protected page is on print material, your theme was applied recently and it stopped working. I can’t take them to another page first which is how the first plug-in works. The second one you suggested will password protect the site itself, not individual pages. I have looked through documentation and support forums on how to get the password protection to work with a custom template but every piece of code I have tried is not working with this theme. If you needed to password protect a custom template in your Enfold theme, how would you do it? The standard wordpress password protection is not working. I gave the code as to how it is wrapped, is there something that should be different or modified there? Please advise,
thank youMay 11, 2015 at 8:41 am #442256Hi!
Can you please provide the custom template code on pastebin.com? We would like to check it. This is the code needed in order to check if the page is password protected: https://codex.wordpress.org/Function_Reference/post_password_required
Regards,
IsmaelMay 11, 2015 at 3:43 pm #442500This reply has been marked as private.May 11, 2015 at 3:45 pm #442503I will try adding that in and see if that does anything.
May 12, 2015 at 11:02 am #442919May 12, 2015 at 3:58 pm #443107not working. I have tried every combo on every forum. Every time I add something it tells me there is a syntax error in this line
<main class='template-page content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
I am not a php programmer so I don’t know what the error is. It doesn’t like the mark-up. Please look at my post on pastebin and advise. We use this theme a lot and have several of our customers that we recommend this to and purchase it frequently, we need to know that we can add a custom template if need be and the password protection actually work.
May 13, 2015 at 10:16 pm #444016you can close this ticket, had errors corrected
May 14, 2015 at 11:28 am #444230 -
AuthorPosts
- The topic ‘Custom Template file password protection not working’ is closed to new replies.