Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The Header for our theme.
- *
- * Displays all of the <head> section and everything up till <div id="main">
- *
- */
- ?><!DOCTYPE html>
- <html <?php language_attributes(); ?>>
- <head>
- <meta charset="<?php bloginfo( 'charset' ); ?>" />
- <title><?php
- if (weaver_getopt('ttw_hide_metainfo')) {
- wp_title(''); /* this is compatible with SEO plugins */
- } else {
- /*
- * Print the <title> tag based on what is being viewed.
- */
- global $page, $paged;
- wp_title( '|', true, 'right' );
- /* Add the blog name. */
- bloginfo( 'name' );
- /* Add the blog description for the home/front page. */
- $site_description = get_bloginfo( 'description', 'display' );
- if ( $site_description && ( is_home() || is_front_page() ) )
- echo " | $site_description";
- /* Add a page number if necessary: */
- if ( $paged >= 2 || $page >= 2 )
- echo ' | ' . sprintf( __( 'Page %s', WEAVER_TRANS ), max( $paged, $page ) );
- }
- ?></title>
- <link rel="profile" href="http://gmpg.org/xfn/11" />
- <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
- <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
- <?php
- /* add our custom css file */
- if (file_exists(weaver_get_css_filename()) && !weaver_getopt('ttw_force_inline_css')) { // generate inline CSS
- wp_register_style('weaver-style-sheet',weaver_get_css_url());
- wp_enqueue_style('weaver-style-sheet');
- }
- /* We add some JavaScript to pages with the comment form
- * to support sites with threaded comments (when in use).
- */
- if ( is_singular() && get_option( 'thread_comments' ) )
- wp_enqueue_script( 'comment-reply' );
- if (weaver_getopt('ttw_use_superfish')) {
- wp_enqueue_script( 'jquery' );
- wp_enqueue_script('weaverSFhoverIntent', get_template_directory_uri().'/js/superfish/hoverIntent.js');
- wp_enqueue_script('weaverSF', get_template_directory_uri().'/js/superfish/superfish.js');
- }
- ?>
- <!-- Begin FB Sharing for WP by Chad Von Lind. Get the latest code here: http://vonlind.com/?p=539 -->
- <?php
- $thumb = get_post_meta($post->ID,'_thumbnail_id',false);
- $thumb = wp_get_attachment_image_src($thumb[0], false);
- $thumb = $thumb[0];
- $default_img = get_bloginfo('stylesheet_directory').'/images/default_icon.jpg';
- ?>
- <?php if(is_single() || is_page()) { ?>
- <meta property="og:type" content="article" />
- <meta property="og:title" content="<?php single_post_title(''); ?>" />
- <meta property="og:description" content="<?php
- while(have_posts()):the_post();
- $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", get_the_excerpt());
- echo apply_filters('the_excerpt_rss', $out_excerpt);
- endwhile; ?>" />
- <meta property="og:url" content="<?php the_permalink(); ?>"/>
- <meta property="og:image" content="<?php if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
- <?php } else { ?>
- <meta property="og:type" content="article" />
- <meta property="og:title" content="<?php bloginfo('name'); ?>" />
- <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
- <meta property="og:description" content="<?php bloginfo('description'); ?>" />
- <meta property="og:image" content="<?php if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
- <?php } ?>
- <!-- End FB Sharing for WP -->
- <?php
- wp_head();
- if (weaver_getopt('ttw_use_superfish')) {
- echo("<script>
- jQuery(function(){jQuery('ul.sf-menu').superfish({animation: {opacity:'show',height:'show'}, speed: 'fast'});});
- </script>\n");
- }
- ?>
- </head>
- <body <?php body_class(); ?>>
- <div id="wrapper" class="hfeed">
- <?php
- $per_page_code = weaver_get_per_page_value('page-pre-header-code'); /* or on a per page basis! */
- if (!empty($per_page_code)) {
- echo(do_shortcode($per_page_code));
- } else {
- weaver_put_area('preheader'); /* here to allow total header replacement */
- }
- if (!weaver_is_checked_page_opt('ttw-hide-header')) { ?>
- <div id="header">
- <?php
- if (is_active_sidebar('header-widget-area')) { /* weaver header widget area */
- ob_start(); /* use output buffering */
- $success = dynamic_sidebar('header-widget-area');
- $content = ob_get_clean();
- if ($success) {
- ?>
- <div id="ttw-head-widget" class="ttw-head-widget-area" role="complementary" ><ul>
- <?php echo($content) ; ?>
- </ul></div> <!-- #ttw-header-widget -->
- <?php
- } /* end if non-empty widgets */
- }
- ?>
- <div id="masthead">
- <?php
- /* ======== SITE TITLE ======== */
- if (!weaver_is_checked_page_opt('ttw-hide-site-title')) { ?>
- <div id="ttw-site-logo"></div>
- <div id="ttw-site-logo-link" onclick="location.href='<?php echo home_url( '/' ); ?>';" style="cursor:pointer;"></div>
- <?php
- if (!weaver_getopt('ttw_hide_site_title')){ /* TTW - hide site title */ ?>
- <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
- <<?php echo $heading_tag; ?> id="site-title">
- <span>
- <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
- </span>
- </<?php echo $heading_tag; ?>>
- <div id="site-description"><?php bloginfo( 'description' ); ?></div>
- <?php } /* end hide site title if */
- } /* end per page hide-site-title */ ?>
- <?php
- /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */
- ?>
- <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>
- <?php
- /* ======== TOP MENU ======== */
- get_template_part('nav','top');
- /* ======== HEADER INSERT CODE ======== */
- echo("\n\t ".'<div id="branding" role="banner">' . "\n");
- $per_page_code = weaver_get_per_page_value('page-header-insert-code'); /* or on a per page basis! */
- if (!empty($per_page_code)) {
- echo(do_shortcode($per_page_code));
- } elseif (weaver_getopt('ttw_header_insert')) { /* header insert defined? */
- if (weaver_getopt('ttw_header_frontpage_only')) {
- if (is_front_page()) {
- echo (do_shortcode(weaver_getopt('ttw_header_insert')));
- }
- } else {
- echo (do_shortcode(weaver_getopt('ttw_header_insert')));
- }
- }
- /* The Dynamic Headers shows headers on a per page basis - will also optionally add site link */
- if (function_exists('show_media_header')) show_media_header(); /* **Dynamic Headers** built-in support for plugin */
- do_action('wvrx_extended_header_insert'); /* add any extension header insert */
- do_action('wvrx_super_header_insert'); /* future extension */
- /* ======== HEADER IMAGE ======== */
- if (!weaver_is_checked_page_opt('ttw-hide-header-image')) {
- if (HEADER_IMAGE_HEIGHT > 0 && !(weaver_getopt('ttw_header_frontpage_only') && is_front_page() )) {
- if (weaver_getopt('ttw_link_site_image')) {
- ?>
- <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
- <?php
- }
- /* Check if this is a post or page, if it has a thumbnail, and if it's a big one */
- if ( is_singular() && !weaver_getopt('ttw_hide_featured_header')
- && has_post_thumbnail( $post->ID )
- && ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) /* $src, $width, $height */
- && $image[1] >= HEADER_IMAGE_WIDTH) {
- /* Houston, we have a new header image! */
- echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
- } else {
- ?>
- <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
- <?php
- }
- if (weaver_getopt('ttw_link_site_image')) echo("</a>\n"); /* need to close link */
- } /* closes header > 0 */
- } /* end ttw-hide-header-image */ ?>
- </div><!-- #branding -->
- <?php
- /* ======== BOTTOM MENU ======== */
- get_template_part('nav','bottom');
- ?>
- </div><!-- #masthead -->
- </div><!-- #header -->
- <?php
- } /* end of hide whole header */
- weaver_put_area('postheader'); ?>
- <div id="main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement