Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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,
    Jack

    #1053926

    Hey 110percent,

    Thank you for using Enfold.

    We need to see the actual modifications. Please post the page.php codes on pastebin.com.

    Best regards,
    Ismael

    #1054058

    Hi 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,
    Jack

    #1054246

    Ok, 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, 11 months ago by 110percent.
    #1054889

    Hi,

    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,
    Ismael

    #1054943

    Hi 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,
    Jack

    #1054945

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

    #1054975

    When my password protect is on it loads page.php, when the page is public it loads a file I don’t know which one?!

    #1056434

    Hi,

    Are you using the advance layout builder? You have to edit the template-builder.php file.

    Best regards,
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.