• 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

How do you make a hook on only the home page?

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 › General Discussion › How do you make a hook on only the home page?

This topic is: not resolved

Tagged: genesis_after_header, is_front_page

  • This topic has 8 replies, 4 voices, and was last updated 8 years, 8 months ago by Brad Dalton.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • May 9, 2017 at 10:27 am #206184
    carnelldesign
    Member

    I want to put a full length image below the header on just the home page. This is easy to accomplish an all pages but NOT just one page.

    Do I do this in functions.php and if so how do you put it just on the home page? Or should I make a home page template and if so what code do I put into the template to display the graphic?

    https://www.orlandographicscompany.com
    May 9, 2017 at 10:55 am #206187
    Victor Font
    Moderator

    Off hand it looks like you're already using a custom page template for the home page. You are definitely using a custom built theme, so without access to your code, it's not possible to provide guidance. I would contact the developer that built the theme for you.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 9, 2017 at 12:53 pm #206201
    Andrea Rennick
    Member

    WordPress code uses php conditionals to do things on specific pages.

    http://codex.wordpress.org/Conditional_Tags


    **forum signature**
    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    May 9, 2017 at 2:31 pm #206206
    Brad Dalton
    Participant

    There's at least 4 ways you can add your image after the header using the genesis_after_header hook.

    1. Add the code directly to your themes existing front-page.php or home.php file.

    2. If your theme doesn't include a front_page.php file, create one and add the code in either file.

    3. Hook the image in via a custom function in your child themes functions file using (as Andrea suggested ) a conditional tag like:

    if ( is_front_page() )
    

    4. Add a widget after the header and add the HTML for your image to a text widget in the after header widget area.


    Tutorials for StudioPress Themes.

    May 9, 2017 at 3:50 pm #206208
    Brad Dalton
    Participant

    Here's some code you can use.


    Tutorials for StudioPress Themes.

    May 10, 2017 at 2:55 am #206232
    carnelldesign
    Member

    Thanks! For some reason method 2 isn't working. I did get method 3 to work. But I need more customization. Any idea how to add HTML below the header?

    May 10, 2017 at 3:08 am #206234
    carnelldesign
    Member

    I actually got it working with method 3. I noticed that had a div tag in there. So it worked out perfect! Thanks 🙂

    May 10, 2017 at 8:44 am #206246
    carnelldesign
    Member

    So "if ( is_front_page() )" calls to the home page. What if I want to put it on a different page? Like my about us page.

    May 10, 2017 at 3:28 pm #206256
    Brad Dalton
    Participant

    Please use this page about conditional tags on the WordPress Codex as a guide.

    As you can see, there are several methods.

    Note : All methods are tested and working.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘General Discussion’ 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

© 2026 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