• 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 banners on different 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 banners on different pages

This topic is: not resolved

Tagged: Agency, banner, header

  • This topic has 29 replies, 3 voices, and was last updated 12 years, 5 months ago by Brad Dalton.
Viewing 20 posts - 1 through 20 (of 30 total)
1 2 →
  • Author
    Posts
  • January 24, 2013 at 2:46 pm #14389
    fiddles5
    Member

    Hi -- I'd like to have one banner on the home page, using the widgeted area in the header-right for ads, and a different shorter banner in height, but with no ads on the right -- the banner would be across the entire top of the page on ALL of the site's other pages. Using the Agency Theme - Here is the dev site:  http://portsmouthhistory.org/newdev/

    How can I do this?

    Thanks!

     

     

    January 24, 2013 at 3:03 pm #14393
    Brad Dalton
    Participant

    Using conditional tags with the Genesis Simple Hooks plugin.

    <?php if ( !is_home() ) { ?>
    <div>Banner-HTML-Code-Goes-Here</div>
    <?php } ?>
    

    Tutorials for StudioPress Themes.

    January 24, 2013 at 3:12 pm #14394
    Brad Dalton
    Participant

    This is exactly what i used on my local system. I uploaded the image using the exact width from the header with align centre.

    Pasted this code in this hook location.

    genesis_before_header Hook

    <?php if ( !is_home() ) { ?>
    <div><a href="http://127.0.0.1:4001/wordpress/?attachment_id=178" rel="attachment wp-att-178"><img class="aligncenter size-full wp-image-178" alt="banner" src="http://127.0.0.1:4001/wordpress/wp-content/uploads/2013/01/banner.png" width="960" height="115" /></a></div>
    <?php } ?>
    

    Tutorials for StudioPress Themes.

    January 24, 2013 at 3:15 pm #14395
    fiddles5
    Member

    thanks, Brad -- but I'm using the header-right widgeted area only on the home page.  I don't see how the "Banner-html-code-goes-here" would support that only on the home page and not on the other pages ?

    I'd also need the banner area for all of the other pages to be half the height of the home page banner. Is that an easy fix?

    thanks again!  I am not really that familiar with php - probably know just enough to be dangerous...

     

    January 24, 2013 at 3:22 pm #14402
    Brad Dalton
    Participant

    hahaha. Sorry didn't answer your question on the widget.

    This is only for the banner to display on all pages excluding the home page.

    'I’d also need the banner area for all of the other pages to be half the height of the home page banner. Is that an easy fix?'

    Yes. Make the banner half the height.

    Try this first please and then we'll hit the widget.


    Tutorials for StudioPress Themes.

    January 24, 2013 at 3:57 pm #14411
    fiddles5
    Member

    okay -- look at this page for the result I got with the code I used:  http://www.portsmouthhistory.org/newdev/discover-portsmouth/

    Here is the code I used: <?php if ( !is_home() ) { ?>
    <div><img src="http://www.portsmouthhistory.org/newdev/wp-content/themes/agency/images/bannerhalf.png" /></div>
    <?php } ?>

    and checkmarked execute php on this hook.

    This in the Genesis before header hook - or should it be put in genesis header hook?  and then what to checkmark?

     

    January 24, 2013 at 3:59 pm #14412
    fiddles5
    Member

    sorry - that's a quote mark, not ”

    January 24, 2013 at 4:24 pm #14427
    Brad Dalton
    Participant

    Looks fine and it doesn't display on the home page. Is this what you wanted?


    Tutorials for StudioPress Themes.

    January 24, 2013 at 4:29 pm #14432
    fiddles5
    Member

    Maybe you aren't seeing the same thing I see?  It works, sort of, but I see 2 banners -- one on top of the other -- on all the pages except the home page.  So I see the shorter banner, and then right below it the home page banner with the rotating ads on the right.  So no, this isn't what I wanted.   I see 2 banners in Firefox and in Safari so it doesn't appear to be a browser issue.   So there must be some extra php to hide the header on the other pages?

    I so appreciate your help with this!

    January 24, 2013 at 4:37 pm #14434
    SoZo
    Member

    You could do it all with css. Set the header default rules to what you want the interior pages to have. i.e. the height, background etc. and add "display: none;" to #header .widget-area then use the .home body class to create separate rules to target the div on the home page, i.e.

    .home #header .widget-area { display: visible; }

    I would increase the height of #title-area a so that the link covers your entire header image as well.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    January 24, 2013 at 4:54 pm #14440
    Brad Dalton
    Participant

    No problem. Firstly i wanted to see if you are happy with the position of the smaller banner.

    Now we Just need to remove the larger header from all pages except the home page right?

    Or you can take Johns suggestion and use CSS


    Tutorials for StudioPress Themes.

    January 24, 2013 at 5:01 pm #14444
    fiddles5
    Member

    Yes, Brad -- I'd like to try your suggestion, and save John's for another time, thank you!  And thank you John!  I see what you mean.

    So yes, let's remove the larger header from all the pages except the home page!

    January 24, 2013 at 5:02 pm #14445
    SoZo
    Member

    To remove the header on every page but the home page add this to functions.php

    add_action(get_header, remove_header);
    function remove_header() {
    if( ! is_home())
    remove_action( 'genesis_header', 'genesis_do_header' );
    }

    I would make the interior image a link back to the home page as well.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    January 24, 2013 at 5:45 pm #14463
    fiddles5
    Member

    okay. added that to the bottom of functions.php but it didn't do anything.  http://www.portsmouthhistory.org/newdev/discover-portsmouth/

     

    Any suggestions?

    January 24, 2013 at 6:36 pm #14477
    SoZo
    Member

    I think the issue is the single quotes end up fancy in the forum so write it out instead of copy pasting and use this instead

    add_action(get_header, remove_header);
    function remove_header() {
    if( ! is_home())
    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 );
    }
    

    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    January 24, 2013 at 6:44 pm #14480
    fiddles5
    Member

    Okay John, I'm going to try it with CSS.  Here's what I tried so far that didn't work:

    #header .widget-area {
    float: right;
    padding: 0px 0 0;
    width: 262px;
    margin-right:-70px;
    display:none;
    }

    .home #header .widget-area { display: visible; }

    I added display:none to the #header .widget-area rule, then used the .home class as you had it in your post.

    What that did was hide the widget-area on the home page.  So that didn't work.  What am I missing?

    The body element for the home page looks like this: <body class="home blog custom-header header-image full-width-content agency">

    I used the Appearance > Header  to add a custom header, and changed the dimensions in the functions.php file.

    http://www.portsmouthhistory.org/newdev/

    help?

     

    January 24, 2013 at 6:49 pm #14483
    fiddles5
    Member

    Yikes!  That works for non-home pages:  http://www.portsmouthhistory.org/newdev/discover-portsmouth/

    But now the home page has no banner and no navigation! http://www.portsmouthhistory.org/newdev/

    (I'll leave it like that for a few minutes so you can see it... thanks John!

     

    January 24, 2013 at 6:50 pm #14484
    fiddles5
    Member

    sorry I should clarify John -- I'm talking about adding your supplied php to the functions.php doc, not the css issue.

    January 24, 2013 at 6:53 pm #14487
    Brad Dalton
    Participant

    You could put the home page header image HTML with a conditional tag in the genesis_header Hook

    <?php if (is_home() ) { ?>
    <div><a href="http://127.0.0.1:4001/wordpress/wp-content/uploads/2013/01/header1.png"><img src="http://127.0.0.1:4001/wordpress/wp-content/uploads/2013/01/header1.png" alt="header1.png" width="960" height="115" class="aligncenter size-full wp-image-180" /></a></div>
    <?php } ?>
    

    This works as i tested it. Change the hook location if needed.


    Tutorials for StudioPress Themes.

    January 24, 2013 at 7:05 pm #14488
    fiddles5
    Member

    Thanks Brad, I did that, and you can see what happens. I get both banners on the home page, on top of eachother, and the large banner that i don't want on all the other pages.  Still not working for me. http://portsmouthhistory.org/newdev/

    John's latest php addition to the functions.php file didn't do it either.

    But you must be on the right track as things are definitely happening with the header! Just not things I'd like to have happen!  LOL!

    Any other suggestions?

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 30 total)
1 2 →
  • 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