Return to Snippet

Revision: 15003
at June 19, 2009 21:33 by kristarella


Updated Code
function custom_header() {
    if (is_home()) {
        echo '<h1 id="logo" class="home"><a href="' . get_bloginfo('url') . '"><img src="' . THESIS_CUSTOM_FOLDER . '/home-header.jpg" alt="' . get_bloginfo('name') . '" /></a></h1>';
        echo '<div id="header_ad" class="home">HOME ADVERT CODE HERE</div>';
    }
    else {
        echo '<p id="logo"><a href="' . get_bloginfo('url') . '"><img src="' . THESIS_CUSTOM_FOLDER . '/home-header.jpg" alt="' . get_bloginfo('name') . '" /></a></p>';
        echo '<div id="header_ad">OTHER ADVERT CODE HERE</div>';
    }
}
remove_action('thesis_hook_header', 'thesis_default_header');
add_action('thesis_hook_header','custom_header');

Revision: 15002
at June 19, 2009 21:32 by kristarella


Initial Code
function custom_header() {
    if (is_home()) {
        echo '<h1 id="logo" class="home"><a href="' . get_bloginfo('url') . '"><img src="' . THESIS_CUSTOM_FOLDER . '/home-header.jpg" alt="' . get_bloginfo('name') . '" /></a></h1>';
        echo '<div id="header_ad" class="home">HOME ADVERT CODE HERE</div>';
    }
    else {
        echo '<p id="logo"><a href="' . get_bloginfo('url') . '"><img src="' . THESIS_CUSTOM_FOLDER . '/second-header.jpg" alt="' . get_bloginfo('name') . '" /></a></p>';
        echo '<div id="header_ad">OTHER ADVERT CODE HERE</div>';
    }
}
remove_action('thesis_hook_header', 'thesis_default_header');
add_action('thesis_hook_header','custom_header');

Initial URL

                                

Initial Description
This creates a custom HTML header in Thesis with a logo and an advert section (to be used instead of CSS image replacement).

Example CSS to use with it:

.custom #header:after {content:"."; display:block; height:0; clear:both; visibility:hidden;}

.custom #header #logo {width:320px; height:90px; float:left;}

.custom #header #header_ad {width:728px; height:90px; float:right;}

Initial Title
Header replacement in Thesis

Initial Tags
wordpress

Initial Language
PHP