PageRenderTime 49ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/themes/OneMozilla/header.php

https://github.com/fvignals/One-Mozilla-blog
PHP | 88 lines | 76 code | 12 blank | 0 comment | 19 complexity | cc7917b337d90d9f147a5652fee69bdf MD5 | raw file
  1. <?php $theme_options = onemozilla_get_theme_options(); ?>
  2. <!DOCTYPE html>
  3. <html <?php language_attributes(); ?> id="mozilla-blog">
  4. <head>
  5. <meta charset="<?php bloginfo('charset'); ?>">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- For Facebook -->
  8. <meta property="og:site_name" content="<?php bloginfo('name'); ?>">
  9. <meta property="og:title" content="<?php if (is_singular()) : single_post_title(); else : bloginfo('name'); endif; ?>">
  10. <meta property="og:url" content="<?php if (is_singular()) : the_permalink(); else : bloginfo('url'); endif; ?>">
  11. <meta property="og:description" content="<?php fc_meta_desc(); ?>">
  12. <?php if (is_singular() && has_post_thumbnail()) : ?>
  13. <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); ?>
  14. <meta property="og:image" content="<?php echo $thumb['0']; ?>">
  15. <?php elseif (get_header_image()) : ?>
  16. <meta property="og:image" content="<?php echo get_header_image(); ?>">
  17. <?php endif; ?>
  18. <meta name="title" content="<?php if (is_singular()) : single_post_title(); echo ' | '; endif; bloginfo('name'); ?>">
  19. <meta name="description" content="<?php fc_meta_desc(); ?>">
  20. <meta name="Rating" content="General">
  21. <!--[if IE]>
  22. <meta name="MSSmartTagsPreventParsing" content="true">
  23. <meta http-equiv="imagetoolbar" content="no">
  24. <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  25. <script src="<?php bloginfo('stylesheet_directory'); ?>/js/html5.js"></script>
  26. <![endif]-->
  27. <link rel="copyright" href="#colophon">
  28. <link rel="profile" href="http://gmpg.org/xfn/11">
  29. <link rel="shortcut icon" type="image/ico" href="<?php echo get_template_directory_uri(); ?>/img/favicon.ico">
  30. <?php if ( $theme_options['share_posts'] == 1 ) : ?>
  31. <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/css/socialshare.css">
  32. <?php endif; ?>
  33. <link rel="stylesheet" type="text/css" media="screen,projection" href="<?php bloginfo('stylesheet_url'); ?>">
  34. <link rel="stylesheet" type="text/css" media="all" href="https://www.mozilla.org/tabzilla/media/css/tabzilla.css">
  35. <link rel="stylesheet" type="text/css" media="print" href="<?php echo get_template_directory_uri(); ?>/css/print.css">
  36. <!--[if lte IE 7]><link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/css/ie7.css"><![endif]-->
  37. <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>">
  38. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
  39. <title><?php
  40. if ( is_single() ) { single_post_title(); echo ' | '; bloginfo('name'); }
  41. elseif ( is_home() || is_front_page() ) { bloginfo('name'); if (get_bloginfo('description','display')) { echo ' | '. get_bloginfo('description','display'); } fc_page_number(); }
  42. elseif ( is_page() ) { single_post_title(''); echo ' | '; bloginfo('name'); }
  43. elseif ( is_search() ) { printf( __('Search results for “%s”', 'onemozilla'), esc_html( $s ) ); fc_page_number(); echo ' | '; bloginfo('name'); }
  44. elseif ( is_day() ) { $post = $posts[0]; printf(__('Posts from %s', 'onemozilla'), get_the_date()); echo ' | '; bloginfo('name'); fc_page_number(); }
  45. elseif ( is_month() ) { $post = $posts[0]; printf(__('Posts from %s', 'onemozilla'), get_the_date('F, Y')); echo ' | '; bloginfo('name'); fc_page_number(); }
  46. elseif ( is_year() ) { $post = $posts[0]; printf(__('Posts from %s', 'onemozilla'), get_the_date('Y')); echo ' | '; bloginfo('name'); fc_page_number(); }
  47. elseif ( is_404() ) { _e('Not Found', 'onemozilla'); echo ' | '; bloginfo('name'); }
  48. else { wp_title(''); echo ' | '; bloginfo('name'); fc_page_number(); }
  49. ?></title>
  50. <script type="text/javascript">
  51. var _gaq = _gaq || [];
  52. _gaq.push(['_setAccount', 'UA-36116321-4']);
  53. _gaq.push(['_trackPageview']);
  54. (function() {
  55. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  56. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  57. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  58. })();
  59. </script>
  60. <?php if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } ?>
  61. <?php wp_head(); ?>
  62. </head>
  63. <body <?php body_class($theme_options[color_scheme]); ?> role="document">
  64. <div id="page"><div class="wrap">
  65. <nav id="nav-access">
  66. <ul role="navigation">
  67. <li><a href="#content-main" tabindex="1"><?php _e( 'Skip to main content', 'onemozilla' ); ?></a></li>
  68. <li><a href="#content-sub" tabindex="2"><?php _e( 'Skip to sidebar', 'onemozilla' ); ?></a></li>
  69. <?php if ( is_active_widget( false, false, 'search', true ) || ( !is_active_sidebar('sidebar') ) ) : ?>
  70. <li><a href="#search" tabindex="3"><?php _e( 'Skip to blog search', 'onemozilla' ); ?></a></li>
  71. <?php endif; ?>
  72. </ul>
  73. </nav>
  74. <?php get_template_part( 'masthead' ); ?>
  75. <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => 'nav', 'container_id' => 'nav-primary', 'fallback_cb' => 'false', ) ); ?>
  76. <div id="content">