Advertisement
Digitalraindrops

Header Logo

May 9th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2.  
  3. //This replaces header_style function in functions.php
  4. function header_style() {
  5. if(!get_header_image() ) return;
  6. ?>
  7. <style type="text/css">
  8. #header-logo{
  9.     background: url(<?php header_image(); ?>) no-repeat;
  10.     float: left;
  11.     height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
  12.     width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
  13.     margin: 0;
  14.     overflow: hidden;
  15.     color: transparent;
  16. }
  17. #header h1 a{display:none;}
  18. #tagline_text{display:none;}
  19. </style>
  20. <?php
  21. }
  22.  
  23. //This goes in header-logo.php
  24. <?php if(!get_header_image() ) : ?>
  25. <div id="header-logo" onclick="location.href='<?php bloginfo('url'); ?>'" style="cursor: pointer;" >
  26.     <img src="<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>" />
  27. </div>
  28. <?php endif; ?>
  29.  
  30. <!-- This change second line only in Header.php -->
  31. <div id="header">
  32. <?php get_template_part( 'header', 'logo' ); //Add in the Logo ?>
  33. <h1 id="logo_text"><a href="<?php echo home_url(); ?>"><?php echo bloginfo('name'); ?></a></h1>
  34. <p id="tagline_text"><?php echo get_bloginfo ( 'description' );  ?></p>
  35. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement