Advertisement
Guest User

west side story

a guest
Jan 31st, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.16 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Header for our theme.
  4. *
  5. * Displays all of the <head> section and everything up till <div id="main">
  6. *
  7. */
  8. ?><!DOCTYPE html>
  9. <html <?php language_attributes(); ?>>
  10. <head>
  11. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  12.  
  13. <title><?php
  14. if (weaver_getopt('ttw_hide_metainfo')) {
  15. wp_title(''); /* this is compatible with SEO plugins */
  16. } else {
  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', WEAVER_TRANS ), max( $paged, $page ) );
  35. }
  36. ?></title>
  37.  
  38. <link rel="profile" href="http://gmpg.org/xfn/11" />
  39. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  40. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  41.  
  42.  
  43. <?php
  44. /* add our custom css file */
  45. if (file_exists(weaver_get_css_filename()) && !weaver_getopt('ttw_force_inline_css')) { // generate inline CSS
  46. wp_register_style('weaver-style-sheet',weaver_get_css_url());
  47. wp_enqueue_style('weaver-style-sheet');
  48. }
  49.  
  50. /* We add some JavaScript to pages with the comment form
  51. * to support sites with threaded comments (when in use).
  52. */
  53. if ( is_singular() && get_option( 'thread_comments' ) )
  54. wp_enqueue_script( 'comment-reply' );
  55.  
  56. if (weaver_getopt('ttw_use_superfish')) {
  57. wp_enqueue_script( 'jquery' );
  58. wp_enqueue_script('weaverSFhoverIntent', get_template_directory_uri().'/js/superfish/hoverIntent.js');
  59. wp_enqueue_script('weaverSF', get_template_directory_uri().'/js/superfish/superfish.js');
  60.  
  61. }
  62. ?>
  63.  
  64. <!-- Begin FB Sharing for WP by Chad Von Lind. Get the latest code here: http://vonlind.com/?p=539 -->
  65. <?php
  66. $thumb = get_post_meta($post->ID,'_thumbnail_id',false);
  67. $thumb = wp_get_attachment_image_src($thumb[0], false);
  68. $thumb = $thumb[0];
  69. $default_img = get_bloginfo('stylesheet_directory').'/images/default_icon.jpg';
  70.  
  71. ?>
  72.  
  73. <?php if(is_single() || is_page()) { ?>
  74. <meta property="og:type" content="article" />
  75. <meta property="og:title" content="<?php single_post_title(''); ?>" />
  76. <meta property="og:description" content="<?php
  77. while(have_posts()):the_post();
  78. $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", get_the_excerpt());
  79. echo apply_filters('the_excerpt_rss', $out_excerpt);
  80. endwhile; ?>" />
  81. <meta property="og:url" content="<?php the_permalink(); ?>"/>
  82. <meta property="og:image" content="<?php if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
  83. <?php } else { ?>
  84. <meta property="og:type" content="article" />
  85. <meta property="og:title" content="<?php bloginfo('name'); ?>" />
  86. <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
  87. <meta property="og:description" content="<?php bloginfo('description'); ?>" />
  88. <meta property="og:image" content="<?php if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
  89. <?php } ?>
  90. <!-- End FB Sharing for WP -->
  91.  
  92.  
  93. <?php
  94. wp_head();
  95. if (weaver_getopt('ttw_use_superfish')) {
  96. echo("<script>
  97. jQuery(function(){jQuery('ul.sf-menu').superfish({animation: {opacity:'show',height:'show'}, speed: 'fast'});});
  98. </script>\n");
  99. }
  100. ?>
  101. </head>
  102.  
  103. <body <?php body_class(); ?>>
  104. <div id="wrapper" class="hfeed">
  105.  
  106. <?php
  107. $per_page_code = weaver_get_per_page_value('page-pre-header-code'); /* or on a per page basis! */
  108. if (!empty($per_page_code)) {
  109. echo(do_shortcode($per_page_code));
  110. } else {
  111. weaver_put_area('preheader'); /* here to allow total header replacement */
  112. }
  113.  
  114. if (!weaver_is_checked_page_opt('ttw-hide-header')) { ?>
  115. <div id="header">
  116. <?php
  117. if (is_active_sidebar('header-widget-area')) { /* weaver header widget area */
  118. ob_start(); /* use output buffering */
  119. $success = dynamic_sidebar('header-widget-area');
  120. $content = ob_get_clean();
  121. if ($success) {
  122. ?>
  123. <div id="ttw-head-widget" class="ttw-head-widget-area" role="complementary" ><ul>
  124. <?php echo($content) ; ?>
  125. </ul></div> <!-- #ttw-header-widget -->
  126. <?php
  127. } /* end if non-empty widgets */
  128. }
  129. ?>
  130. <div id="masthead">
  131. <?php
  132. /* ======== SITE TITLE ======== */
  133. if (!weaver_is_checked_page_opt('ttw-hide-site-title')) { ?>
  134. <div id="ttw-site-logo"></div>
  135. <div id="ttw-site-logo-link" onclick="location.href='<?php echo home_url( '/' ); ?>';" style="cursor:pointer;"></div>
  136. <?php
  137. if (!weaver_getopt('ttw_hide_site_title')){ /* TTW - hide site title */ ?>
  138. <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  139. <<?php echo $heading_tag; ?> id="site-title">
  140. <span>
  141. <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  142. </span>
  143. </<?php echo $heading_tag; ?>>
  144. <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  145. <?php } /* end hide site title if */
  146. } /* end per page hide-site-title */ ?>
  147.  
  148. <?php
  149. /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */
  150. ?>
  151. <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', WEAVER_TRANS ); ?>"><?php _e( 'Skip to content', WEAVER_TRANS ); ?></a></div>
  152.  
  153. <?php
  154. /* ======== TOP MENU ======== */
  155.  
  156. get_template_part('nav','top');
  157.  
  158. /* ======== HEADER INSERT CODE ======== */
  159. echo("\n\t ".'<div id="branding" role="banner">' . "\n");
  160.  
  161. $per_page_code = weaver_get_per_page_value('page-header-insert-code'); /* or on a per page basis! */
  162. if (!empty($per_page_code)) {
  163. echo(do_shortcode($per_page_code));
  164. } elseif (weaver_getopt('ttw_header_insert')) { /* header insert defined? */
  165. if (weaver_getopt('ttw_header_frontpage_only')) {
  166. if (is_front_page()) {
  167. echo (do_shortcode(weaver_getopt('ttw_header_insert')));
  168. }
  169. } else {
  170. echo (do_shortcode(weaver_getopt('ttw_header_insert')));
  171. }
  172. }
  173.  
  174. /* The Dynamic Headers shows headers on a per page basis - will also optionally add site link */
  175. if (function_exists('show_media_header')) show_media_header(); /* **Dynamic Headers** built-in support for plugin */
  176.  
  177. do_action('wvrx_extended_header_insert'); /* add any extension header insert */
  178. do_action('wvrx_super_header_insert'); /* future extension */
  179.  
  180. /* ======== HEADER IMAGE ======== */
  181.  
  182. if (!weaver_is_checked_page_opt('ttw-hide-header-image')) {
  183. if (HEADER_IMAGE_HEIGHT > 0 && !(weaver_getopt('ttw_header_frontpage_only') && is_front_page() )) {
  184. if (weaver_getopt('ttw_link_site_image')) {
  185. ?>
  186. <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
  187. <?php
  188. }
  189. /* Check if this is a post or page, if it has a thumbnail, and if it's a big one */
  190. if ( is_singular() && !weaver_getopt('ttw_hide_featured_header')
  191. && has_post_thumbnail( $post->ID )
  192. && ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) /* $src, $width, $height */
  193. && $image[1] >= HEADER_IMAGE_WIDTH) {
  194. /* Houston, we have a new header image! */
  195. echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
  196. } else {
  197. ?>
  198. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  199. <?php
  200. }
  201. if (weaver_getopt('ttw_link_site_image')) echo("</a>\n"); /* need to close link */
  202. } /* closes header > 0 */
  203. } /* end ttw-hide-header-image */ ?>
  204.  
  205. </div><!-- #branding -->
  206. <?php
  207. /* ======== BOTTOM MENU ======== */
  208. get_template_part('nav','bottom');
  209. ?>
  210.  
  211. </div><!-- #masthead -->
  212. </div><!-- #header -->
  213.  
  214. <?php
  215. } /* end of hide whole header */
  216. weaver_put_area('postheader'); ?>
  217.  
  218. <div id="main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement