document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. /**
  3. * Functions to handle the custom header
  4. *
  5. * @package itx_themes
  6. * @version 2.1
  7. */
  8. define('HEADER_IMAGE', itx_header_bg_default());
  9. define('HEADER_IMAGE_WIDTH', itx_header_bg_width());
  10. define('HEADER_IMAGE_HEIGHT', itx_get_option('header','bg_height'));
  11. define('NO_HEADER_TEXT', true );
  12. define('HEADER_TEXTCOLOR', '');
  13. add_custom_image_header('','');
  14. if (function_exists('register_default_headers')){
  15. register_default_headers(itx_setting('head_bg'));
  16. }
  17.  
  18. function itx_header_bg_default(){
  19. $headbg=$headbg=itx_setting('head_bg',itx_default_option('header','head_bg'));
  20. return $headbg['url'];
  21. }
  22.  
  23. function itx_header_bg_width(){
  24. extract(itx_get_option('layout'));
  25. if ($wrapping=='fixed') return $wrap;
  26. else return $max_width;
  27. }
  28.  
  29. function itx_header(){
  30. extract(itx_get_option('header'));
  31. if ($head_type==1){
  32. echo'
  33. <div id="headerwrap">';
  34. if (!$scope) echo '<div id="header" class="wrap">';
  35. echo '<div class="clear"></div>
  36. <a href="'.get_option('home').'/" title="'.htmlspecialchars(get_bloginfo('name')).'">
  37. <img src="'.$logo.'" alt="'.htmlspecialchars(get_bloginfo('name')).'" title="'.htmlspecialchars(get_bloginfo('name')).'" />
  38. </a>';
  39. if (!$scope) echo '</div>';
  40. echo '</div>';
  41. }else{
  42. echo'
  43. <div id="headerwrap"><div class="clear"></div>
  44. <div id="header" class="wrap">';
  45. if ( is_home() || is_front_page() ){
  46. echo '<h1 class="header"><a href="'.get_option('home').'">'.get_bloginfo('name').'</a></h1>';
  47. } else {
  48. echo '<div class="header"><a href="'.get_option('home').'">'.get_bloginfo('name').'</a></div>';
  49. }
  50. echo'<span class="tagline">'.get_bloginfo('description').'</span>
  51. </div>
  52. </div>';
  53. }
  54. }
  55.  
  56. function itx_header_styles(){
  57. $halfwrap=$fullwrap='';
  58. extract(itx_get_option('header'));
  59.  
  60. $height=empty($height)?'':" height:$height;";
  61. if (function_exists('register_default_headers')){
  62. $bg=(empty($image))?get_header_image():$image;
  63. } else {
  64. if (!get_theme_mod('header_image')){
  65. $headbg=itx_setting('head_bg',$head_bg);
  66. $bg=sprintf($headbg['url'],get_template_directory_uri());
  67. }
  68. if (empty($bg)) $bg=$image;
  69. }
  70. $bg=(empty($bg))?'':"url($bg)";
  71. $img="background:$bgcolor $bg $repeat $h_align $v_align;$height";
  72. if ($scope==1) $fullwrap=$img;
  73. else $halfwrap=$img;
  74. if (itx_get_option('layout','wrapping')=='fixed') $maxw=itx_get_option('layout','wrap').'px';
  75. else $maxw='98%';
  76. echo "
  77. #headerwrap{ $fullwrap text-align: $text_align;}
  78. #header{ $halfwrap }
  79. #header .header {font-size: {$font_size};}
  80. #header .header a {color: $color;text-decoration: none;}
  81. #header .header a:hover {color: $hover_color;}
  82. #header img{max-width:$maxw;}
  83. #header .tagline {font-size: {$span_font_size};color: $span_color;}";
  84. }
  85. add_action('itx_styles','itx_header_styles');
  86. ?>
');