• 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

Different Headers on Pages

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 › Different Headers on Pages

This topic is: not resolved

Tagged: header

  • This topic has 12 replies, 4 voices, and was last updated 12 years, 7 months ago by derekalvarez.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • October 28, 2013 at 2:59 pm #69519
    virtual
    Member

    Is there a way to change the header for specific pages?

    http://hg.virtuallyassistingu.com/
    October 28, 2013 at 3:31 pm #69526
    emasai
    Participant

    Try this from Brad Dalton
    http://wpsites.net/web-design/using-different-headers-on-different-pages-of-the-genesis-2-0-sample-theme/


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    October 28, 2013 at 6:13 pm #69552
    virtual
    Member

    This is great info. Thanks so much. I should be able to get it done for specific pages.

    December 13, 2013 at 1:36 pm #78865
    derekalvarez
    Member

    What if I want to change the header for all pages that have /idx/ as the parent?

    Would this be possible by creating a custom page template? If so, can you point me to a tutorial talking about how to do this?

    December 13, 2013 at 4:06 pm #78909
    Brad Dalton
    Participant

    If you want the same header in all pages using the template you could hard code it into the template otherwise you can use conditional tags to display it on specific templates.

    Another option is to use a plugin like WP Display Header

    Or this http://wordpress.org/plugins/custom-header-extended/


    Tutorials for StudioPress Themes.

    December 13, 2013 at 4:15 pm #78918
    derekalvarez
    Member

    Thanks, Brad!

    I think hardcoding it into the template would be best because we're using an IDX that automatically generates pages and then I can make those use my template.

    Is there a tutorial on changing headers by using a custom template you can point me to?

    December 14, 2013 at 3:43 pm #79116
    derekalvarez
    Member

    Hi Brad, I created a template called "Real Estate Home Page". I used this code to remove the header, breadcrumbs, and footer...

    <?php
    /**
     * This file adds the Real Estate Home Page template to the News Child Theme.
     *
     * @author Derek Alvarez
     * @package News
     * @subpackage Customizations
     */
    
    /*
    Template Name: Real Estate Home Page
    */
    
    // Remove header, breadcrumbs, footer widgets 
    remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
    remove_action( 'genesis_header', 'genesis_do_header' );
    remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    
    genesis();

    Can you help me with the code to add a different header?

    Url is...
    http://cortezcolorado.net/real-estate/mockup/

    December 14, 2013 at 4:55 pm #79127
    derekalvarez
    Member

    I'm screwing up somehow. I created a file called, "real_estate_header.php" with this code and added it to my child theme...

    <?php
    /**
     * Real Estate Header
     *
     * @package Custom Header
     * @author  Derek Alvarez
     */
    
    do_action( 'genesis_doctype' );
    do_action( 'genesis_title' );
    do_action( 'genesis_meta' );
    
    wp_head(); //* we need this for plugins
    ?>
    </head>
    <?php
    genesis_markup( array(
    	'html5'   => '<body %s>',
    	'xhtml'   => sprintf( '<body class="%s">', implode( ' ', get_body_class() ) ),
    	'context' => 'body',
    ) );
    do_action( 'genesis_before' );
    
    genesis_markup( array(
    	'html5'   => '<div %s>',
    	'xhtml'   => '<div id="wrap">',
    	'context' => 'site-container',
    ) );
    
    do_action( 'genesis_before_header' );
    
    <img src="<?php header_image(); ?>" height="<?php echo get_real_estate_header()->height; ?>" width="<?php echo get_real_estate_header()->width; ?>" alt="" />
    
    do_action( 'genesis_after_header' );
    
    genesis_markup( array(
    	'html5'   => '<div %s>',
    	'xhtml'   => '<div id="inner">',
    	'context' => 'site-inner',
    ) );
    genesis_structural_wrap( 'site-inner' );

    Then I added this code to my page template...

    <?php
    /**
     * This file adds the Real Estate Home Page template to the News Child Theme.
     *
     * @author Derek Alvarez
     * @package News
     * @subpackage Customizations
     */
    
    /*
    Template Name: Real Estate Home Page
    */
    
    // Remove header, breadcrumbs, footer widgets 
    remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
    remove_action( 'genesis_header', 'genesis_do_header' );
    remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    
    add_action( 'genesis_after_header', 'real_estate_header' );
    
    genesis();

    Then I added this to my functions.php file...

    /** Add support for custom Real Estate Header */
    $args = array(
    	'width'         => 960,
    	'height'        => 120,
    	'default-image' => get_template_directory_uri() . '/images/cc-header-real-estate.jpg',
    );
    add_theme_support( 'real-estate-header', $args );

    But that broke my site. What am I doing wrong?

    December 15, 2013 at 12:08 am #79188
    Brad Dalton
    Participant

    Try this http://sridharkatakam.com/custom-page-template-genesis-shows-featured-image-banner/


    Tutorials for StudioPress Themes.

    December 15, 2013 at 12:06 pm #79261
    derekalvarez
    Member

    It appears this is for making the featured image for each page become the header.

    How can I make this work for a specific header image I want to use for all pages with "real-estate" or "idx" as their parent?

    Would it be something like...

    add_action ( 'genesis_before_header', 'real_estate_header' );
    function real_estate_header() {
     
    echo '<div class="real-estate-header">
    <div class="wrap">
    <img src="get_template_directory_uri() . '/images/cc-header-real-estate.jpg" />
    </div>
    </div>';
    }
     
    }

    Sorry, I know just enough code to be dangerous!

    December 16, 2013 at 12:59 pm #79504
    derekalvarez
    Member

    Alright, I have now managed to get the header in there, but I don't know how to center it or link it to http://cortezcolorado.net/real-estate. Where I'm at now is the only code I have is this, which I put in my page_real_estate_home.php template file...

    <?php
    /**
    
        This file adds the Real Estate Home Page template to the News Child Theme. *
        @author Derek Alvarez
        @package News
        @subpackage Customizations */
    
    /*
    Template Name: Real Estate Home Page
    */
    
    // Remove header, breadcrumbs, footer widgets
    remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
    remove_action( 'genesis_header', 'genesis_do_header' );
    remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    
    add_action ( 'genesis_before_header', 'real_estate_header' );
    function real_estate_header() {
    
    global $post;
    
    {
    echo '
    ';
    echo '';
    echo '
    ';
    }
    
    }
    
    genesis();
    December 17, 2013 at 11:17 am #79789
    derekalvarez
    Member

    I just realized it ate my code! Here's the correct code...

    https://gist.github.com/derekalvarez/8008701

    December 17, 2013 at 2:47 pm #79818
    derekalvarez
    Member

    I have the header centered and linking to the page I want. Here's the code I used...

    https://gist.github.com/derekalvarez/8008701

    I also added some css...

    .real-estate-header {
    	background-color: #fff;
    	border-left: 1px solid #d5d5d5;
    	border-right: 1px solid #d5d5d5;
    	border-top: 1px solid #d5d5d5;
    	height: 120px;
    	margin: 0 auto;
    	overflow: hidden;
    	width: 960px;
    }

    Now what do I have to do to make sure each page puts my Genesis SEO meta info into each page's header?

  • Author
    Posts
Viewing 13 posts - 1 through 13 (of 13 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

© 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