Header replacement in Thesis


/ Published in: PHP
Save to your folder(s)

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;}


Copy this code and paste it in your HTML
  1. function custom_header() {
  2. if (is_home()) {
  3. 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>';
  4. echo '<div id="header_ad" class="home">HOME ADVERT CODE HERE</div>';
  5. }
  6. else {
  7. echo '<p id="logo"><a href="' . get_bloginfo('url') . '"><img src="' . THESIS_CUSTOM_FOLDER . '/home-header.jpg" alt="' . get_bloginfo('name') . '" /></a></p>';
  8. echo '<div id="header_ad">OTHER ADVERT CODE HERE</div>';
  9. }
  10. }
  11. remove_action('thesis_hook_header', 'thesis_default_header');
  12. add_action('thesis_hook_header','custom_header');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.