Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need custom header to display only on home

  • @glamgrif

    Participant

    You can see that the header at Bizolly also shows up on profile pages and all of the other “main” site pages. It’s a 227Kb flash header, but the height is a little much to be on all the pages. Driving me nuts! I wound up setting the header div to display:none and creating a div just for the flash. That fixed most of the problem I was having (that the custom header bg would still show up), but the flash header still shows up on all pages.

    Been working on a solution for this, but it’s slow going. The traditional WP method for custom header images doesn’t seem to work with this and tried a few different if/then and get statements.

    Would love to get some input from others on this =)

Viewing 12 replies - 1 through 12 (of 12 total)
  • @r-a-y

    Keymaster

    Open up your header.php, do a conditional check for the homepage and output the flash header only.

    eg.

    <?php
    if ( is_front_page() || !bp_current_component() || ( is_home() && bp_is_page( 'home' ) ) ) : ?>

    <div class="flash">

    <object width="950" height="260">
    <param name="movie" value="http://bizolly.com/flashfinal.swf">

    <embed src="http://bizolly.com/flashfinal.swf" width="950" height="260">
    </embed>
    </object>
    <noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="950" height="260" id="flash header updated" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="flash header updated.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="flash header updated.swf" quality="high" bgcolor="#ffffff" width="950" height="260" name="flash header updated" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
    </object>
    </noscript>

    </div>

    <?php
    endif; ?>

    @glamgrif

    Participant

    Thanks Ray! I am giving this a shot! Modifying it so that other pages have their own headers (which are basic .pngs). Will update with the results!

    @ruffrazor

    Member

    @r-a-y Can you tell me how I can use this code on the other pages.

    Members page
    Groups page
    Forums page
    And Single Post Pages

    @djpaul

    Keymaster

    @ruffrazor It’s as easy as putting it into the theme template files you require. Assume you’re building a child theme?

    @glamgrif

    Participant

    Just wanted to update with what worked for me. The Echo would not work, no matter how I tweaked it, but this works so can’t complain. =)

    `


    `

    My final code, with flash on the front page, and a static header on subsequent pages. http://pastebin.com/3tCZ1Zfu
    `


    `

    @nooi

    Participant

    This has helped me a lot. So if you check my site, it has bizolly’s swf up on it. I uploaded my own but it just shows a blank :-( Don’t know what I’m doing wrong here. It works with bizolly’s perfectly, but not with mine?

    Please, please help

    @modemlooper

    Moderator

    link?

    @nooi

    Participant

    http://www.thehcgprofessor.com

    Now I got it to display my swf, but the alignment is off :-( I don’t want all the spaces.

    @hnla

    Participant

    That’s a theming / presentational issue which you need to address through the CSS / markup.

    In this case if you are referring to (Please be explicit about where you see issues) the space above the swf then you have an empty paragraph tag there for no reason; you need to remove that to close the gap.

    As for the horizontal alignment I’m afraid you have a fixed width element in a fluid layout and will always have issue with narrower browser widths the fixed width now dictates the min-width you must set the site layout to work with.

    @nooi

    Participant

    Thank you all, I actually managed to get it 100%

    @abomb1977

    Member

    @r-a-y

    I’m trying to figure exactly what might happen before I try it. I definitely don’t want the WSOD again. So my question is this: can the following code

    `


    `

    be run in the functions.php file? Or does it have to be run in the theme header file?

    I want to display my custom header on the front page, but not the subsequent pages. I’d like the subsequent pages (behind the walls of my pretty little patch) to display a smaller (in height) header, so that the pages don’t look so darn cluttered to logged-in users.

    Ideas?

    @abomb1977

    Member

    @glamgrif

    About that code you tweaked for your variable headers: are you using the custom header that comes bundled? Or did you have to disable that to get your code to work? (Just wondering before I try it ’cause I stress about the WSOD sometimes … LOL.)

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Need custom header to display only on home’ is closed to new replies.
Skip to toolbar