Advertisement
Guest User

header.php

a guest
Nov 18th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.87 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. * @package WordPress
  8. * @subpackage Twenty_Ten
  9. * @since Twenty Ten 1.0
  10. */
  11. ?><!DOCTYPE html>
  12. <html <?php language_attributes(); ?>>
  13. <head>
  14. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  15. <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
  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', 'twentyten' ), max( $paged, $page ) );
  35.  
  36. ?></title>
  37. <link rel="profile" href="http://gmpg.org/xfn/11" />
  38. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  39. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  40.  
  41. <script type="text/javascript" src="<? echo get_bloginfo('template_directory').'/js/jquery.js';?>"></script>
  42. <script type="text/javascript" src="<? echo get_bloginfo('template_directory').'/js/main.js';?>"></script>
  43. <script type="text/javascript" src="<? echo get_bloginfo('template_directory').'/js/jquery.bxSlider.js';?>"></script>
  44.  
  45. <?php
  46. /* We add some JavaScript to pages with the comment form
  47. * to support sites with threaded comments (when in use).
  48. */
  49. if ( is_singular() && get_option( 'thread_comments' ) )
  50. wp_enqueue_script( 'comment-reply' );
  51.  
  52. /* Always have wp_head() just before the closing </head>
  53. * tag of your theme, or you will break many plugins, which
  54. * generally use this hook to add elements to <head> such
  55. * as styles, scripts, and meta tags.
  56. */
  57. wp_head();
  58. ?>
  59.  
  60. <script type="text/javascript">
  61.  
  62. var _gaq = _gaq || [];
  63. _gaq.push(['_setAccount', 'UA-34363212-1']);
  64. _gaq.push(['_trackPageview']);
  65.  
  66. (function() {
  67. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  68. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  69. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  70. })();
  71.  
  72. </script>
  73.  
  74. <meta name="msvalidate.01" content="6F40CD92E66FE4E4B2EB4694463E7F28" />
  75.  
  76. <meta name="google-site-verification" content="aBuH35LZaGUuVhqBoOhmXpWMjXjPBYEnRLK6IwoXKQM" />
  77.  
  78. </head>
  79.  
  80. <body <?php body_class(); ?>>
  81. <?php //echo "<pre>"; print_r($post)?>
  82. <div id="wrapper" class="hfeed">
  83. <div id="header">
  84. <div id="masthead">
  85.  
  86. <div id="branding" role="banner">
  87. <div class="tel_main">
  88. <div class="logo_new"> <a href="http://www.marshalls.co.uk" target="_blank"> <img style="margin-top:10px;" width="90" src="<? echo get_bloginfo('template_directory').'/images/marshalls_logo_hires.png'; ?>" alt="" /></a>
  89.  
  90.  
  91. <a href="http://www.marshalls.co.uk" target="_blank"> <img style="margin-top:10px;" width="90" src="<? echo get_bloginfo('template_directory').'http://www.selandscapeconstruction.co.uk/wp-content/uploads/2012/11/CityGuildsLogo.jpg'; ?>" alt="" /></a>
  92.  
  93. </div>
  94.  
  95.  
  96.  
  97. <div class="request_a_free_quote"><a href=" <?php echo $permalink = get_permalink(166); ?>">GET A FREE QUOTE</a></div>
  98. <div class="request_border">&nbsp;</div>
  99. <div class="tel"><h3><?php echo get_option( 'v_phone' );?></h3></div>
  100. </div>
  101.  
  102. <div class="logo_new_menu"><a href="<?php echo get_option('home');?>"><img src="<? echo get_bloginfo('template_directory').'/images/landscapingmenu.png'; ?>" alt="" /></a></div>
  103.  
  104. <?php
  105. $args = array('sort_column' => 'menu_order');
  106. $menupages = get_pages($args);
  107.  
  108. $args = array(
  109. 'sort_column' => 'menu_order',
  110. 'numberposts' => 100,
  111. 'orderby' => 'post_date',
  112. 'order' => 'DESC',
  113. 'post_type' => 'services',
  114. 'parent' => 0,
  115. 'hierarchical' => true,
  116. 'post_status' => 'publish' );
  117. $services_posts=get_pages( $args );
  118.  
  119. $args = array(
  120. 'sort_column' => 'menu_order',
  121. 'order' => 'ASC',
  122. 'post_type' => 'slider',
  123. 'post_status' => 'publish' );
  124. $slider_posts=get_posts( $args ); ?>
  125.  
  126. <div class="navbar">
  127. <ul>
  128. <li><a <?php if( is_home() ) { echo "class='active'"; }?> href="<?php echo get_option('home');?>">Home</a></li>
  129. <?php foreach($menupages as $menupage) { ?>
  130. <li><a <?php if(($menupage->ID==$post->ID) || ($menupage->ID == 158 && $post->post_type=='services')) echo "class='active'";?> href="<?php echo get_permalink($menupage->ID); ?>"><?php echo $menupage->post_title; ?></a>
  131.  
  132. <?php if($menupage->ID == 158 || $menupage->post_title == 'Landscaping Services') {
  133. echo '<ul>';
  134. foreach ($services_posts as $service_data) {
  135.  
  136. $args = array(
  137. 'sort_column' => 'menu_order',
  138. 'numberposts' => 100,
  139. 'orderby' => 'post_date',
  140. 'order' => 'DESC',
  141. 'post_type' => 'services',
  142. 'parent' => $service_data->ID,
  143. 'hierarchical' => true,
  144. 'child_of' => $service_data->ID,
  145. 'post_status' => 'publish' );
  146. $child_posts=get_pages( $args );
  147.  
  148. $permalink = get_permalink($service_data->ID);
  149. echo '<li class="submenu_parent"><a href=';
  150.  
  151. if(!empty($child_posts))
  152. echo get_permalink($child_posts[0]->ID);
  153. else
  154. echo get_permalink($service_data->ID);
  155.  
  156. echo '>'.$service_data->post_title."</a>";
  157.  
  158. if(!empty($child_posts)) {
  159. echo '<ul>';
  160. foreach ($child_posts as $child_post) {
  161. $permalink = get_permalink($child_post->ID);
  162. echo '<li style="width: 230px;"><a href='.get_permalink($child_post->ID).'>'.$child_post->post_title."</a></li>";
  163. }
  164. echo '</ul>';
  165. }
  166. echo '</li>';
  167. }
  168. echo '</ul>';
  169. } ?>
  170. </li>
  171. <?php } ?>
  172. </ul>
  173. </div>
  174.  
  175. <?php if (is_home()) { ?>
  176. <div class="slider_area">
  177. <div class="slider_inner">
  178. <ul id="slider">
  179. <?php
  180. foreach($slider_posts as $slider_post) {
  181. $url = wp_get_attachment_url( get_post_thumbnail_id($slider_post->ID) ); ?>
  182. <li><img src="<?php echo $url;?>" width="1020" height="517" alt="<?php echo $slider_post->post_title; ?>" title="<?php echo $slider_post->post_content; ?>" /></li>
  183. <?php
  184. }?>
  185. </ul>
  186. </div>
  187. </div>
  188. <?php } ?>
  189. </div>
  190. </div>
  191. </div>
  192. <div id="main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement