different banners on different pages

Community Forums Forums Design Tips and Tricks different banners on different pages

This topic is: not resolved

Tagged: , ,

This topic contains 29 replies, has 3 voices, and was last updated by  braddalton 1 year, 9 months ago.

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #14480

    fiddles5
    Participant
    Post count: 26

    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?

     

    #14483

    fiddles5
    Participant
    Post count: 26

    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!

     

    #14484

    fiddles5
    Participant
    Post count: 26

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

    #14487

    braddalton
    Participant
    Post count: 10217

    You could put the home page header image HTML with a conditional tag in the genesis_header Hook
    [php]
    <?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&quot; alt="header1.png" width="960" height="115" class="aligncenter size-full wp-image-180" /></a></div>
    <?php } ?>
    [/php]

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


    #14488

    fiddles5
    Participant
    Post count: 26

    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?

    #14491

    SoZo
    Moderator
    Post count: 1573

    This is working for me
    [php]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 );
    }}[/php]


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

    #14495

    braddalton
    Participant
    Post count: 10217

    You’ll need to remove the large banner header from Appearance > Header if you add the code i posted because its added using the HTML in the code.


    #14496

    fiddles5
    Participant
    Post count: 26

    perhaps it is a difference in themes? It didn’t work for me. It hid the header AND the navigation on the home page and gave all of my text a weird shadow effect, and messed about with the placement of the footer widgets!  Weird.

    But it DID work on all the other pages EXCEPT the home page.

     

    help?

    #14498

    fiddles5
    Participant
    Post count: 26

    that previous answer was for John.  Brad — I’ll try doing that and see what happens. That’s probably it!

    thanks!

    #14500

    fiddles5
    Participant
    Post count: 26

    Brad — I did that, but something is backwards here.  Now the shorter banner is appearing on the home page, where I DON’t want it. And NO banner is appearing on the other pages.

    So what I want is for the larger header to appear on the home page with the header widget content on the right. And the smaller banner to appear on ALL of the other pages of the site, without the header widget.

     

    #14503

    fiddles5
    Participant
    Post count: 26

    Brad – explain to me what this does:
    if( ! is_home() ) {

    If it’s the home page, then do the following?  Shouldn’t it be if it’s NOT the home page, then do the following?  Is that what the exclamation point means?   if NOT is_home  then do this… ?

    pardon my ignorance of php!

    #14504

    braddalton
    Participant
    Post count: 10217

    !is_home() If its Not the home page.
    is_home() If its the home page

    http://codex.wordpress.org/Conditional_Tags

    You’re also going to have a problem with this code:
    [php]
    /** Add support for custom header */
    add_theme_support( ‘genesis-custom-header’, array( ‘width’ => 960, ‘height’ => 115 ) );
    [/php]

    The height is different for the homepage and other pages so you’ll need a conditional tag here also as you header image banners are different heights.

    The code i supplied works for me. The only problem is the gap caused by the banner height difference


    #14508

    braddalton
    Participant
    Post count: 10217

    Are you using the genesis_header Hook and genesis_before_header Hook?


    #14512

    fiddles5
    Participant
    Post count: 26
    This reply has been marked as private.
    #14526

    braddalton
    Participant
    Post count: 10217

    Me too. Sure. Happy to solve this tomorrow also.


Viewing 15 posts - 16 through 30 (of 30 total)

You must be logged in to reply to this topic.