Site logo

[Resolved] Remove elements using code

Home Forums Support [Resolved] Remove elements using code

Home Forums Support Remove elements using code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1832065
    Mike

    Hi

    Apologies if this is easy / already documented!

    Scenario is: I have an object custom post type, thus have a single-object.php to display that specific single.

    But – I have another bit of the site where I want to show the same information as single-object but in a modal, and without various elements (header, navigation, footer).

    Normally I’d just pass in a querystring, say single-object.php?display=modal or similar – and then use this to hide stuff on the site.

    I can do this in my child theme – but is there a more cunning way using GP hooks / filters?

    Thanks

    Mike

    #1832241
    David
    Staff
    Customer Support

    Hi there,

    if you had a Layout Element created to disable the theme elements you don’t require – then you use this filter for setting the display rules:

    https://docs.generatepress.com/article/generate_layout_element_display/

    #1833340
    Mike

    Hey David – thanks loads, this is really useful and exactly what I’m after.

    cheers

    Mike

    #1833399
    David
    Staff
    Customer Support

    Glad to be of help!

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