Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

GT - Header.php

By: a guest on May 31st, 2012  |  syntax: None  |  size: 12.55 KB  |  hits: 94  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head profile="http://gmpg.org/xfn/11">
  4. <?php global $goe_locate; if($goe_locate){echo $goe_locate;} ?>
  5. <title><?php if(isset($_REQUEST['ptype']) && $_REQUEST['ptype']=='post_listing'){ echo HEADER_ADD_PLACE_SEO;?>&nbsp;|&nbsp;<?php bloginfo('name'); }else?>
  6. <?php if(isset($_REQUEST['ptype']) && $_REQUEST['ptype']=='post_event'){ echo HEADER_ADD_EVENT_SEO;?>&nbsp;|&nbsp;<?php bloginfo('name'); }else?>
  7. <?php if(isset($_REQUEST['ptype']) && $_REQUEST['ptype']=='preview'){ echo HEADER_ADD_PREVIEW_SEO;?>&nbsp;|&nbsp;<?php bloginfo('name'); }else?>
  8. <?php if(isset($_REQUEST['ptype']) && ($_REQUEST['ptype'] == 'register' || $_REQUEST['ptype'] == 'login')){ echo HEADER_LOGIN_REGISTRATION_SEO;?>&nbsp;|&nbsp;<?php bloginfo('name'); }else?>
  9. <?php if(isset($_GET['ptype']) && ($_GET['ptype'] == 'return' || $_GET['ptype'] == 'payment_success')){ echo HEADER_SUCCESS_PAGE_SEO;?>&nbsp;|&nbsp;<?php bloginfo('name'); }else?>
  10. <?php if ( is_home() ) { ?><?php  bloginfo('description'); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
  11. <?php if ( is_search() ) { ?>Search Results&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
  12. <?php if ( is_author() ) { ?>Author Archives&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
  13. <?php if ( is_single() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name');?><?php } ?>
  14. <?php if ( is_page() ) { ?><?php if(wp_title('',false)){ wp_title('');}else{bloginfo('description');} ?>&nbsp;|&nbsp;<?php bloginfo('name');?><?php } ?>
  15. <?php if ( is_archive() ) { ?>
  16. <?php
  17. if(is_category())
  18. {
  19. single_cat_title();
  20. }else
  21. {
  22. global $wp_query, $post;
  23. $current_term = $wp_query->get_queried_object();       
  24. echo $current_term->name;       if($_SESSION['location_name']){echo ' - '.$_SESSION['location_name'];}
  25. }
  26. ?>
  27. &nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
  28. <?php if ( is_month() ) { ?><?php the_time('F'); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
  29. <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php //single_tag_title("", true);
  30. } } ?>
  31. </title>
  32. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
  33. <?php if (is_home()) { ?>
  34. <?php
  35. $location_meta = get_location_meta_desc();
  36. if($location_meta){?>
  37. <meta name="description" content="<?php echo stripslashes($location_meta); ?>" />
  38. <?php }elseif ( get_option('ptthemes_meta_description') <> "" ) { ?>
  39. <meta name="description" content="<?php echo stripslashes(get_option('ptthemes_meta_description')); ?>" />
  40. <?php } ?>
  41. <?php if ( get_option('ptthemes_meta_keywords') <> "" ) { ?>
  42. <meta name="keywords" content="<?php echo stripslashes(get_option('ptthemes_meta_keywords')); ?>" />
  43. <?php } ?>
  44. <?php if ( get_option('ptthemes_meta_author') <> "" ) { ?>
  45. <meta name="author" content="<?php echo stripslashes(get_option('ptthemes_meta_author')); ?>" />
  46. <?php } ?>
  47. <?php }
  48. ############################## META DESCRIPTION & KEYWORDS FIX BY STIOFAN HEBTECH ####################################
  49. else{
  50. $current_term = $wp_query->get_queried_object();
  51. ?>
  52. <meta name="description" content="<?php if (have_posts() && is_single() OR is_page()){while(have_posts()){the_post();
  53. $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", get_the_excerpt());
  54. //echo apply_filters('the_excerpt_rss', $out_excerpt);
  55. echo strip_tags($out_excerpt);
  56. }}
  57. elseif(is_category() || is_tag()){
  58. if(is_category()){echo "Posts related to Category: ".ucfirst(single_cat_title("", FALSE));}
  59. elseif(is_tag()){ echo "Posts related to Tag: ".ucfirst(single_tag_title("", FALSE));}
  60. }
  61. elseif($current_term->taxonomy=='placecategory'){echo str_replace('%location_name%', $_SESSION['location_name'], strip_tags($current_term->description));}
  62. elseif($current_term->taxonomy=='eventcategory'){echo str_replace('%location_name%', $_SESSION['location_name'], strip_tags($current_term->description));}
  63. else{ ?>
  64. <?php echo stripslashes(get_option('ptthemes_meta_description')); //DEFAULT DESCRIPTION IF NONE FOUND ?>
  65. <?php } ?>" />
  66. <meta name="keywords" content="<?php
  67. $posttags = get_the_tags();
  68. if ($posttags) {
  69. foreach($posttags as $tag) {
  70. echo $tag->name . ' ';
  71. }
  72. }else{
  73. $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
  74. $xt = 1;
  75. foreach ($tags as $tag) {
  76. if ($xt <= 20) {
  77. echo $tag->name.", ";
  78. }
  79. $xt++;
  80. }
  81. }
  82. ?>" />
  83. <?php
  84. }
  85. ############################## END META DESCRIPTION & KEYWORDS FIX BY STIOFAN HEBTECH ################################
  86. ?>
  87. <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
  88. <?php $stylesheet = get_option('ptthemes_alt_stylesheet');
  89.         if($stylesheet != 'none' && $stylesheet != '' ){?>
  90. <link href="<?php bloginfo('template_directory'); ?>/skins/<?php echo $stylesheet; ?>" rel="stylesheet" type="text/css" />
  91. <?php } ?>
  92. <?php if ( get_option('ptthemes_favicon') <> "" ) { ?>
  93. <link rel="shortcut icon" type="image/png" href="<?php echo get_option('ptthemes_favicon'); ?>" />
  94. <?php } ?>
  95. <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( get_option('ptthemes_feedburner_url') <> "" ) { echo get_option('ptthemes_feedburner_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>" />
  96. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  97. <?php if ( get_option('ptthemes_scripts_header') <> "" ) { echo stripslashes(get_option('ptthemes_scripts_header')); } ?>
  98. <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/library/css/print.css" media="print" />
  99. <style type="text/css">
  100. <!--
  101. .win #categories_strip ul li a { padding: 8px 15px 7px 15px; display:block; }
  102. -->
  103. </style>
  104.  
  105. <?php wp_head(); ?>
  106. <?php
  107. if ( is_singular() && get_option( 'thread_comments' ) )
  108. wp_enqueue_script( 'comment-reply' );
  109. ?>
  110. <?php if ( get_option('ptthemes_customcss') ) { ?>
  111. <link href="<?php bloginfo('template_directory'); ?>/custom.css" rel="stylesheet" type="text/css">
  112. <?php } ?>
  113. <?php
  114. global $wpdb;
  115. $post_type_js = get_post_type();
  116. if($post_type_js=='place' || $post_type_js=='event' || $_REQUEST['ptype']=='preview' || $_REQUEST['ptype']=='preview_event'){?>
  117. <script type='text/javascript' src='<?php bloginfo('template_directory'); ?>/library/js/post.custom.js'></script>
  118. <script type="text/javascript">
  119. jQuery.ajax({
  120.             cache: true,
  121.             async: true,
  122.             dataType: "script",
  123.             url: 'http://s7.addthis.com/js/250/addthis_widget.js#username=<?php if(get_option('ptthemes_addthis_username')){echo get_option('ptthemes_addthis_username');}else{ echo 'ra-4facd1303678e5c0';}?>'
  124.         });
  125. </script>
  126. <?php } if ( get_option('ptthemes_google_button') ) { ?>
  127. <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  128.  { parsetags: 'explicit' }
  129.  </script>
  130. <?php }?>
  131. </head>
  132. <body <?php body_class(); ?> >
  133. <div id="location_select_wrapper">
  134. <div id="location_select" >
  135. <?php if(get_option('ptthemes_enable_multicity_flag')){ get_location_menu();} ?>
  136. </div>
  137. </div>
  138.  
  139. <div id="page" class="<?php if ( is_home() ) {  echo "top_bg"; } else { echo "top_bg_in"; } ?>" >  
  140. <div id="header_outer">
  141. <div id="header" class="clearfix">
  142. <div class="header_left">
  143. <?php $logo_section = dynamic_sidebar('Logo Section'); if(!$logo_section){ ?>
  144. <?php if (!function_exists('show_logo')) {
  145. function show_logo(){
  146. if ( get_option('ptthemes_show_blog_title') ) { ?>
  147. <div class="blog-title"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
  148. <p class="blog-description"><?php bloginfo('description'); ?></p>
  149. </div>
  150. <?php } else { ?>
  151. <div class="logo">
  152. <a href="<?php echo get_option('home'); ?>/">
  153. <img src="<?php if ( get_option('ptthemes_logo_url') != "" ) { echo get_option('ptthemes_logo_url'); } elseif(get_option('ptthemes_alt_stylesheet')=="none") { echo get_bloginfo('template_directory').'/skins/1-default/logo.png'; } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>"   /></a>
  154. <p class="blog-description"><?php bloginfo('description'); ?></p>
  155. </div>      
  156. <?php } }} show_logo(); }?>
  157. </div> <!-- header left #end -->
  158. <div class="header_right">
  159. <?php if(wp_nav_menu( array( 'theme_location' => 'top_menu','fallback_cb' =>false,'echo' =>false))){wp_nav_menu( array( 'theme_location' => 'top_menu','fallback_cb' =>false,'echo' =>true));}
  160.         elseif(function_exists('dynamic_sidebar') && dynamic_sidebar('Top Navigation') ){}else{  ?>
  161. <ul>    
  162. <li class="hometab <?php if ( is_home() && !isset($_REQUEST['page']) ) { ?> current_page_item <?php } ?>"><a href="<?php echo get_option('home'); ?>/"><?php _e('Home'); ?></a></li>
  163. <?php wp_list_pages('title_li=&depth=0&exclude=' . get_inc_pages("pag_exclude_") .'&sort_column=menu_order');  ?>
  164. </ul>
  165. <?php }
  166. global $current_user;
  167. if($current_user->data->ID) { ?>
  168. <ul class="user_login">
  169. <li class="welcome"> <span><?php echo WELCOME_TEXT;?>, </span>  <a href="<?php echo get_author_link($echo = false, $current_user->data->ID);?>">  <?php printf('%s',$current_user->data->display_name);?></a></li>
  170. <li class="userin"><a href="<?php echo site_url();?>/?ptype=login&amp;action=logout" class="signin"><?php echo LOGOUT_TEXT;?></a></li>
  171. <?php }else{ ?>
  172. <ul class="user_login">
  173. <li class="welcome"><span><?php echo WELCOME_TEXT;?>, <strong><?php echo GUEST_TEXT;?></strong></span> </li>
  174. <li class="userin"><a href="<?php echo site_url();?>/?ptype=login&amp;page1=sign_in" class="signin"><?php echo SIGN_IN_TEXT;?></a></li>
  175. <?php }?>
  176. </ul>
  177. <?php
  178.  
  179. global $ct_on, $child_dir;
  180. if($ct_on && file_exists($child_dir.'/header_searchform.php')){include_once ($child_dir.'/header_searchform.php');}
  181. else{include(TEMPLATEPATH."/header_searchform.php");}
  182. ?>
  183. </div> <!-- header right #end -->
  184. </div> <!-- header #end -->
  185.  
  186. <?php  if(wp_nav_menu( array( 'theme_location' => 'main_menu','fallback_cb' =>false,'echo' =>false))){
  187.         echo '<div id="categories_strip">';
  188.         wp_nav_menu( array( 'theme_location' => 'main_menu','fallback_cb' =>'nav_nav','echo' =>true, 'container' => 'div','container_id'  => 'main_nav_menu'));
  189.         dynamic_sidebar('Header Navigation Right');
  190.         echo '</div>';
  191. }else{
  192.         ?>
  193.    
  194. <div id="categories_strip2">
  195. <?php  
  196. if (function_exists('dynamic_sidebar') && dynamic_sidebar('Main Navigation') ){?>
  197. <div id="fix_loc_select"><?php dynamic_sidebar('Header Navigation Right');echo '</div></div>';}else{ echo '</div><div id="categories_strip"><div id="main_nav_menu">'; ?>
  198. <style>#categories_strip2{display:none;}</style>
  199. <ul>
  200. <li class="<?php if ( is_home() ) { ?>current_page_item<?php } ?> home" ><a href="<?php echo get_option('home'); ?>/"><?php _e('Home');?></a></li>
  201. <?php  if(is_array(get_option('ptthemes_placecategory')))
  202. {
  203. $cat_arr = get_option('ptthemes_placecategory');
  204. if(is_array(get_option('ptthemes_placecategory')) && $cat_arr[0]!='')
  205. {
  206. $blog_cat = implode(',',get_option('ptthemes_placecategory'));
  207. $catlist =  wp_list_categories('title_li=&include=' . $blog_cat .'&echo=0&taxonomy=placecategory');
  208. if(!strstr($catlist,'No categories'))
  209. {
  210. echo $catlist;
  211. }
  212. }
  213. }
  214. ?>  
  215. <?php  if(is_array(get_option('ptthemes_eventcategory')))
  216. {
  217. $cat_arr = get_option('ptthemes_eventcategory');
  218. if(is_array(get_option('ptthemes_eventcategory')) && $cat_arr[0]!='')
  219. {
  220. $event_cat = implode(',',get_option('ptthemes_eventcategory'));
  221. $catlist =  wp_list_categories('title_li=&echo=0&include=' . $event_cat .'&taxonomy=eventcategory');
  222. if(!strstr($catlist,'No categories'))
  223. {
  224. echo $catlist;
  225. }
  226. }
  227. }
  228. ?>  
  229. <?php
  230. $catlist_blog='';
  231. $blog_cat = get_option('ptthemes_blogcategory');
  232. if(is_array(get_option('ptthemes_blogcategory')) && $blog_cat[0]!='')
  233. {
  234. $blog_cat = implode(',',get_option('ptthemes_blogcategory'));  
  235. $catlist_blog =  wp_list_categories('title_li=&include=' . $blog_cat .'&echo=0');
  236. }
  237. if(!strstr($catlist_blog,'No categories'))
  238. {
  239. echo $catlist_blog;
  240. }
  241. ?>
  242. <?php if(get_option('is_user_addevent')=='0'){}else{ ?>
  243. <li class="<?php if ( is_home() && (isset($_REQUEST['ptype']) && $_REQUEST['ptype']=='post_listing') ) { ?>current_page_item<?php } ?>" ><a href="<?php echo site_url(); ?>/?ptype=post_listing"><?php echo ADD_LISTING;?></a></li>
  244. <?php }?>
  245. <?php if(get_option('is_user_eventlist')=='0'){}else{ ?>
  246. <li class="<?php if ( is_home() && (isset($_REQUEST['ptype']) && $_REQUEST['ptype']=='post_event')) { ?>current_page_item<?php } ?>" ><a href="<?php echo site_url(); ?>/?ptype=post_event"><?php echo ADD_EVENT;?></a></li>
  247. <?php }?>
  248. </ul>
  249. <?php dynamic_sidebar('Header Navigation Right');}?>
  250. </div>
  251. <?php }?>
  252. </div>
  253. </div>  <!-- header outer#end -->