• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Simple Hooks… Conditional header info

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Simple Hooks… Conditional header info

This topic is: not resolved

Tagged: featured image, pages, posts, Simple Hooks

  • This topic has 3 replies, 1 voice, and was last updated 12 years, 4 months ago by Tal.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 10, 2013 at 7:33 pm #50162
    Tal
    Member

    I'm using Genesis Simple Hooks to set page banners that use the WP featured image to display a background image in the site header banner (so there are different images depending which page you're on).

    This is set in the "genesis_before_header " section of simple hooks.

    What I need to do now, is apply this ONLY to pages and not posts - can someone help me come up with the code required to achieve this?

    The code I'm using is ...


    <!-- Use page featured image as the page banner -->
    <?php $image_id = get_post_thumbnail_id(); ?>
    <?php $image_url = wp_get_attachment_image_src($image_id,'small'); ?>
    <div id="featured-header">" alt=""></div>
    <!-- end banner image -->

    July 10, 2013 at 7:36 pm #50163
    Tal
    Member

    darn, code strips the script... here's an img of the code

    Header Code

    July 10, 2013 at 7:44 pm #50166
    Tal
    Member

    Hate not being able to edit posts when I think of something more to add.

    For posts - I will want to set a default image for the "featured-header" div instead of using the featured image

    July 11, 2013 at 10:07 pm #50322
    Tal
    Member

    *bump*

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble