[Support request] Custom Page Templates

Home Forums Support [Support request] Custom Page Templates

Home Forums Support Custom Page Templates

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1544394
    Matt

    Hi,

    I’m trying to make a custom template for a membership site. I need to create the external pages (register, sign-in, T’s and C’s) and I want to remove the header on these pages.

    I have used the generate_header hook to remove the main header markup (https://docs.generatepress.com/article/generate_header/) but this doesn’t remove the mobile nav on smaller screens. Is there a specific hook I should be looking for?

    Thanks

    #1544836
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know ๐Ÿ™‚

    #1545186
    Matt

    Hi Leo,

    I think I found the hook I was looking for:

    add_action( 'generate_after_header', 'generate_menu_plus_mobile_header', 5 )

    I have removed this action and it seems to be doing what I was wanting.

    ie

    
    if ( ! is_user_logged_in() )
    	{
    		remove_action( 'generate_after_header', 'generate_menu_plus_mobile_header');
    	}
    

    Thanks

    #1545191
    Leo
    Staff
    Customer Support

    You can actually just create a layout element for that:
    https://docs.generatepress.com/article/layout-element-overview/#disable-element

    Just disable the Site Header and the Mobile Header.

    #1545193
    Matt

    To remove the sites mobile navigation?

    #1545196
    Leo
    Staff
    Customer Support

    Yup – the site header and the mobile header is separated which is why your original solution didn’t work for mobile.

    Creating a layout element would be the best solution.

    #1545211
    Matt

    That’s awesome. So just to be clear on how it works…..

    1. Set up an Element of type ‘Layout’.
    2. Disable any of the elements that I don’t want to show to non-logged in users
    3. On ‘Display Rules’ tab – Set the location to ‘Entire Site’ and the Users to ‘Logged out Users’

    This will then over-ride page Layout settings for any page when the user isn’t logged in?

    Thanks

    #1546661
    Leo
    Staff
    Customer Support

    That sounds correct.

    Try it first?

    #1633552
    Matt

    Hi,

    Just a follow up to this topic. Is there a way with the “Elements” module to remove the mobile navigation, but not the mobile header (logo etc)?

    Thanks

    #1634542
    Tom
    Lead Developer
    Lead Developer

    If you remove the primary navigation using Disable Elements, that should happen.

    However, it also disables the primary nav on desktop, which may not be what you’re looking for?

    In that case, your best bet is to use CSS to hide the toggle in the mobile header:

    #mobile-header .menu-toggle {
        display: none;
    }
    #1634905
    Matt

    Hi Tom,

    That was my understanding too but it’s not what I am seeing.

    What I am trying to do is remove the menu for any user that is logged out (at any screensize).

    Using the Elements module, I have set up layout for Logged Out Users that disables Primary Navigation. The display rules are set to Location – “Entire Site” and Users -“Logged Out”.

    When I view the site in incognito (ie. logged out) this seems to work for desktop size (navigation is not rendered in HTML), but the mobile menu is still being generated and displayed.

    #1635964
    Tom
    Lead Developer
    Lead Developer

    Aha, it seems it’s only set up when using the Disable Elements metabox on the actual page (not via Elements).

    This is definitely a bug – it should work with Elements as well. I’ll be sure to get this added in the next GPP version (alpha coming next week).

    For now, you can use the Disable Elements feature on the page, or some simple CSS to hide it for logged-out users.

    Let me know if you need more info ๐Ÿ™‚

    #1649709
    Matt

    Hi Guys,

    Just following up an this and seeing when the bug fix is likely to make it to production. I have implemented the css fix, but would rather have it resolved before I hand over to the client.

    Thanks

    #1650697
    Tom
    Lead Developer
    Lead Developer

    This fix has been implemented in the next GPP version. We’re trying to get the alpha released this week.

    Thanks!

    #1745544
    Matt

    Hi Tom,

    Just following up on this. It seems that this issue still persists. Any timeline on a fix? Or more likely just wait until 2.0?

    Thanks

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