[Support request] Is it possible to detect whether a page/post title is hidden and hide GP header

Home Forums Support [Support request] Is it possible to detect whether a page/post title is hidden and hide GP header

Home Forums Support Is it possible to detect whether a page/post title is hidden and hide GP header

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1287924
    mrwebsites

    I am hoping that there is a php snippet that I can use to detect whether the title has been turned off (or on) on a page, and then return that in a GP header. That way showing the title in the header is optional.
    If it is turned off in the page editor, it will be hidden in the header. Otherwise it will show.

    #1288798
    David
    Staff
    Customer Support
    #1289370
    mrwebsites

    Thanks Dave!

    That’s definitely a step in the right direction. I can conditionally show html almost anywhere on the page based on the title being disabled or not. But not inside the GP Header element, it seems.

    Does the GP Header element have a hook? I am trying to show or hide the title of the page in the GP header, based on the pages title being disabled or not.

    I cannot run php inside the GP Header element. I cannot use a hook to target the GP Header element. Any advice on how I can do this?

    #1289698
    David
    Staff
    Customer Support

    Is there any other content in the Hero?
    If there is none then you could use that condition with the generate_page_hero_output filter.

    Example of that filter being used here:

    https://generatepress.com/forums/topic/write-php-inside-custom-page-headers/page/2/#post-1237983

    If that doesn’t work i can check with Tom – he’s bound to have something up his sleeve.

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