Advertisement
Guest User

Mantra header.php

a guest
Feb 8th, 2012
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.49 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Header
  4. *
  5. * Displays all of the <head> section and everything up till <div id="main">
  6. *
  7. * @package Cryout Creations
  8. * @subpackage mantra
  9. * @since mantra 0.5
  10. */
  11. ?><!DOCTYPE html>
  12. <html <?php language_attributes(); ?>>
  13. <head>
  14. <meta http-equiv="X-UA-Compatible" content="IE=9" />
  15. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  16. <title><?php
  17. /*
  18. * Print the <title> tag based on what is being viewed.
  19. */
  20. global $page, $paged;
  21.  
  22. wp_title( '|', true, 'right' );
  23.  
  24. // Add the blog name.
  25. bloginfo( 'name' );
  26.  
  27. // Add the blog description for the home/front page.
  28. $site_description = get_bloginfo( 'description', 'display' );
  29. if ( $site_description && ( is_home() || is_front_page() ) )
  30. echo " | $site_description";
  31.  
  32. // Add a page number if necessary:
  33. if ( $paged >= 2 || $page >= 2 )
  34. echo ' | ' . sprintf( __( 'Page %s', 'mantra' ), max( $paged, $page ) );
  35.  
  36. ?></title>
  37. <link rel="profile" href="http://gmpg.org/xfn/11" />
  38. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  39. <link rel="shortcut icon" href="<?php echo home_url( '/' ); ?>favicon.ico" />
  40. <?php
  41. /* This retrieves admin options. */
  42.  
  43. $mantra_options= mantra_get_theme_options();
  44. foreach ($mantra_options as $key => $value) {
  45. ${"$key"} = $value ;
  46. }
  47. $totalwidth= $mantra_sidewidth+$mantra_sidebar+50;
  48.  
  49.  
  50. /* Always have wp_head() just before the closing </head>
  51. * tag of your theme, or you will break many plugins, which
  52. * generally use this hook to add elements to <head> such
  53. * as styles, scripts, and meta tags.
  54. */
  55. mantra_header();
  56. wp_head(); ?>
  57.  
  58. </head>
  59.  
  60. <body <?php body_class(); ?>>
  61. <script>
  62. jQuery(document).ready(function() {
  63. jQuery("#content img").addClass("<?php echo 'image'.$mantra_image;?>");
  64. });
  65.  
  66. </script>
  67.  
  68. <div id="toTop">^ <?php _e("Back to Top","mantra") ?></div>
  69.  
  70. <div id="wrapper" class="hfeed">
  71. <div id="header">
  72.  
  73. <div id="masthead">
  74. <div id="branding" role="banner">
  75. <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  76. <<?php echo $heading_tag; ?> id="site-title">
  77. <span>
  78. <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  79. </span>
  80. </<?php echo $heading_tag; ?>>
  81. <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  82.  
  83. <?php
  84. // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  85. if ( is_singular() &&
  86. has_post_thumbnail( $post->ID ) && $mantra_fheader == "Enable" &&
  87. ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  88. $image[1] >= HEADER_IMAGE_WIDTH ) :
  89. // Houston, we have a new header image!
  90. echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
  91. ?> <style> #access {margin-top:<?php echo $image[2]+10;?>px !important;} </style> <?php
  92. else : ?><?php if (get_header_image() != '') { ?>
  93.  
  94. <style> #branding { background:url(<?php header_image(); ?>) no-repeat;
  95. width:<?php echo HEADER_IMAGE_WIDTH; ?>px;
  96. height:<?php echo HEADER_IMAGE_HEIGHT; ?>px; } }
  97. </style>
  98. <?php } else { ?><?php } ?><?php endif; ?>
  99. <div style="clear:both;"></div>
  100. </div><!-- #branding -->
  101.  
  102. <div id="access" role="navigation">
  103. <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
  104. <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'mantra' ); ?>"><?php _e( 'Skip to content', 'mantra' ); ?></a></div>
  105. <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */
  106. ?><?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  107. </div><!-- #access -->
  108. </div><!-- #masthead -->
  109.  
  110. <div style="clear:both;"> </div>
  111.  
  112.  
  113.  
  114.  
  115. </div><!-- #header -->
  116. <div id="main">
  117. <div id="forbottom" >
  118. <div id="socials">
  119.  
  120. <?php if ($mantra_social1 && $mantra_social2) { ?><a href="<?php echo $mantra_social2; ?>" class="socialicons" id="<?php echo $mantra_social1; ?>" title="<?php echo $mantra_social1; ?>"><img alt="<?php echo $mantra_social1; ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.$mantra_social1.'.png'; ?>" /></a><?php }
  121. ?><?php if ($mantra_social3 && $mantra_social4) { ?><a href="<?php echo $mantra_social4 ?>" class="socialicons" id="<?php echo $mantra_social3 ?>" title="<?php echo $mantra_social3 ?>"><img alt="<?php echo $mantra_social3; ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.$mantra_social3.'.png'; ?>" /></a><?php }
  122. ?><?php if ($mantra_social5 && $mantra_social6) { ?> <a href="<?php echo $mantra_social6 ?>" class="socialicons" id="<?php echo $mantra_social5 ?>" title="<?php echo $mantra_social5 ?>"><img alt="<?php echo $mantra_social5; ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.$mantra_social5.'.png'; ?>" /></a> <?php }
  123. ?><?php if ($mantra_social7 && $mantra_social8) { ?> <a href="<?php echo $mantra_social8 ?>" class="socialicons" id="<?php echo $mantra_social7 ?>" title="<?php echo $mantra_social7 ?>"><img alt="<?php echo $mantra_social7; ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.$mantra_social7.'.png'; ?>" /></a> <?php }?>
  124. </div>
  125. <div style="clear:both;"> </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement