Site logo

[Resolved] Header Element Conditional

Home Forums Support [Resolved] Header Element Conditional

Home Forums Support Header Element Conditional

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1043201
    Antar

    Hello, All –

    I’m sure I must have asked this before…

    I want to create a page header displaying the featured image as a mast head. It works fine if an image is loaded but not when one is missing. To create the space for the image to appear it is necessary to add padding or set a min-height on the parent div. If the user fails to load a featured image on the page (for some reason) that space still remains.

    Would it be possible to create a function that removes this empty space if no featured image is loaded?

    Thanks,

    Antar

    #1043219
    David
    Staff
    Customer Support

    Hi there,

    Tom provides a snippet here that will remove the specific Header Element if no featured image is added:

    https://generatepress.com/forums/topic/suppressing-hero-on-pages-without-feature-image/#post-980046

    #1043679
    Antar

    Bloody marvelous!

    Thanks.

    #1043730
    David
    Staff
    Customer Support

    Glad we could be of help

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