Tagged: page.php, visibility
-
AuthorPosts
-
January 14, 2019 at 1:30 am #1053474
Hello,
I have a page which has the visibility password protect, I have written some code in my page.php child theme file which only loads
get_template_part( 'includes/loop', 'page' );
if the query string equals a certain custom user role, this all works fine! HOWEVER, when I turn off the password protect it doesn’t recognise my page.php script??? Any code I add into page.php in my child theme doesn’t load, so I’f I had<h1> HELLO WORLD </h1>
in to the page it doesn’t come up on my page, but when I put the password protection back on it works. Any ideas??Are the page.php different dependent on the visibility of the page, if it has a password protection or not?
Thank you for your help!
Kind regards,
JackJanuary 15, 2019 at 3:33 am #1053926Hey 110percent,
Thank you for using Enfold.
We need to see the actual modifications. Please post the page.php codes on pastebin.com.
Best regards,
IsmaelJanuary 15, 2019 at 11:30 am #1054058Hi Ismael,
Thanks for getting back to me.
See the private content with a link to pastebin. Excuse the dodgy php code.Please note even if you remove my decryption and query string stuff and just put a <h1> Hello world </h1> before get_template_part(‘includes/loop’, ‘page’); , it still doesn’t load unless you have the password protection on the page.
Thanks,
JackJanuary 15, 2019 at 6:32 pm #1054246Ok, I’ve added a new example: https://pastebin.com/ynJ8Hdrp
I think my previous code the example was too complicated with the query string php code. So I’ve made a simpler example of my problem…
I have a page called /new-resource-page (Page ID: 4614), I’ve made a custom page.php file where I run an if statement, IF the page is page ID 4614 load in the body a <h1> tag with a restricted page message. ELSE get_template_part( ‘includes/loop’, ‘page’ );
The problem is, when the pages password protection is on it works correctly by reading my IF ELSE statement and loads the restricted message I’ve added, but when I remove the password protection it loads the page body! It’s either loading another file which isn’t my page.php, or it’s ignoring my IF ELSE statement. I can’t work out why. If anyone can help that would be amazing!
Thanks,
Jack- This reply was modified 5 years, 10 months ago by 110percent.
January 17, 2019 at 8:54 am #1054889Hi,
Did you remove this line?
$avia_config['size'] = avia_layout_class( 'main' , false) == 'fullsize' ? 'entry_without_sidebar' : 'entry_with_sidebar';
I think it’s not working because the content container doesn’t have these class attributes.
Best regards,
IsmaelJanuary 17, 2019 at 11:37 am #1054943Hi Ismael,
Thanks for noticing that, sorry I had deleted that line to see if it fixed anything. I’ve re added that line above the ‘get_template_part( ‘includes/loop’, ‘page’ );’ line, the same as it is on the Enfold page.php file.
I am still getting the issue.
Kind regards,
JackJanuary 17, 2019 at 11:55 am #1054945What are the other possible Enfold page files my pages could be loading except page.php ?? Because I put <h1>Loading…</h1> in my custom and enfolds page.php and page loops and it doesn’t display the heading?
January 17, 2019 at 12:43 pm #1054975When my password protect is on it loads page.php, when the page is public it loads a file I don’t know which one?!
January 21, 2019 at 6:20 am #1056434 -
AuthorPosts
- You must be logged in to reply to this topic.