web/wp-content/themes/selecta/header.php
changeset 1 0d28b7c10758
equal deleted inserted replaced
0:0d9a58d2c515 1:0d28b7c10758
       
     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" <?php language_attributes(); ?>>
       
     3 <head profile="http://gmpg.org/xfn/11">
       
     4 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
       
     5 <?php if(is_single()) :
       
     6 	global $wpdb;
       
     7 	setup_postdata($post);
       
     8 	echo "\n<meta name=\"keywords\" content=\"".fetch_post_tags($post->ID)."\" />";
       
     9 	echo "\n<meta name=\"description\" content=\"".str_replace("\n", "", $post->post_excerpt)."\" />";
       
    10 endif; ?>
       
    11 
       
    12 <title><?php bloginfo('name'); ?><?php wp_title(" - ", true, "left"); ?></title>
       
    13 <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" />
       
    14 <?php if(isset($_GET["use_colour"])) :?>
       
    15 	<link href="<?php bloginfo('template_directory'); ?>/color-styles/<?php echo $_GET["use_colour"]; ?>/style.css" rel="stylesheet" type="text/css" />
       
    16 <?php elseif(isset($_COOKIE["ocmx_theme_style"])) :?>
       
    17 	<link href="<?php bloginfo('template_directory'); ?>/color-styles/<?php echo $_COOKIE["ocmx_theme_style"]; ?>/style.css" rel="stylesheet" type="text/css" />
       
    18 <?php elseif(get_option("ocmx_theme_style") !== "") : ?>
       
    19 	<link href="<?php bloginfo('template_directory'); ?>/color-styles/<?php echo get_option("ocmx_theme_style"); ?>/style.css" rel="stylesheet" type="text/css" />
       
    20 <?php endif; ?>
       
    21 
       
    22 <?php if(get_option("ocmx_rss_url")) : ?>
       
    23 	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?>" href="<?php echo get_option("ocmx_rss_url"); ?>">
       
    24 <?php else : ?>
       
    25 	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?>" href="<?php bloginfo("rss2_url"); ?>">
       
    26 <?php endif; ?>
       
    27 
       
    28 <script src="<?php bloginfo('template_directory'); ?>/scripts/jquery.js" type="text/javascript" language="javascript1.5"></script>
       
    29 <script src="<?php bloginfo('template_directory'); ?>/scripts/selecta_jquery.js" type="text/javascript" language="javascript1.5"></script>
       
    30 
       
    31 <?php wp_head(); ?>
       
    32 </head>
       
    33 <body>
       
    34 <!--[if lt IE 7]>
       
    35 	<div class="no_ie">
       
    36 		<h1>Please note, your browser is out of date!</h1>
       
    37 		<p class="error">We highly recommend that you upgrade your browser. Our suggestion: <a href="http://www.getfirefox.com">Mozilla Firefox</a>.</p>
       
    38 	</div>
       
    39 <![endif]-->
       
    40 <div id="header-container">
       
    41 	<div class="container-header-dark-normal"><span></span></div>
       
    42 	<div id="header" class="clearfix">
       
    43 		<h1 class="logo">
       
    44 			<?php if(get_option("ocmx_custom_logo")) : ?>
       
    45                 <a href="<?php bloginfo('url'); ?>" class="logo"><img src="<?php echo get_bloginfo("wpurl"); ?>/wp-content/uploads/<?php echo get_option("ocmx_custom_logo"); ?>" alt="<?php bloginfo('name'); ?>" /></a>
       
    46             <?php else : ?>
       
    47                 <a href="<?php bloginfo('url'); ?>" class="logo"><img src="<?php bloginfo('template_directory'); ?>/images/logo.png" alt="<?php bloginfo('name'); ?>" /></a>
       
    48             <?php endif; ?>
       
    49 		</h1>
       
    50 		<ul id="menu">
       
    51 			<li class="parent-item"><a class="parent-link" href="<?php bloginfo('url'); ?>">Home</a></li>
       
    52             <?php ocmx_menu(); ?>
       
    53 		</ul>
       
    54 	</div>
       
    55 	<div class="container-footer-dark-dark"><span></span></div>
       
    56 </div>
       
    57 <?php 
       
    58 global $is_archive; ?>
       
    59     <div id="feature-post-container" class="clearfix">
       
    60         <div id="feature-post" class="clearfix">
       
    61 			<?php if($is_archive) :?>
       
    62             	<h1>Archives Section</h1>
       
    63 				<?php
       
    64 					$last_month = "";
       
    65 					$month_count=1;
       
    66 					$fetch_archive = $wpdb->get_results("SELECT * FROM " . $wpdb->posts . " WHERE post_status='publish' AND post_type = 'post' GROUP BY $wpdb->posts.ID ORDER BY post_date DESC");
       
    67 					foreach($fetch_archive as $archive_data) :
       
    68 						if(date("m Y", strtotime($archive_data->post_date)) !== $last_month) :?>
       
    69 							<a  href="#" id="archive-href-<?php echo $month_count; ?>" class="archive-date"><?php echo date("M Y", strtotime($archive_data->post_date)); ?></a>
       
    70 				<?php		$month_count++; 
       
    71 						endif;
       
    72 						$last_month = date("m Y", strtotime($archive_data->post_date));
       
    73 					endforeach; ?>
       
    74 			<?php elseif(is_category()) : ?>
       
    75 	            <h1><?php single_cat_title(); ?></h1>
       
    76 			<?php elseif (is_search()) : ?>
       
    77 		    	<h1>Your Search Results for "<em><?php the_search_query(); ?></em>"</h1>
       
    78 			<?php elseif(is_page()) : ?>
       
    79                 <?php if (have_posts()) : while (have_posts()) : the_post();    	        
       
    80                     setup_postdata($post); ?>
       
    81                             <h1><?php the_title(); ?></h1>
       
    82                 <?php endwhile; endif; ?>
       
    83             <?php elseif(is_single() || is_page()) : ?>
       
    84                 <?php if (have_posts()) : while (have_posts()) : the_post();    	        
       
    85                         setup_postdata($post);
       
    86                         //Fetch the Custom Metas for this post
       
    87                         $get_thumbnail = get_post_meta($post->ID, "other_media", true);;
       
    88                         $get_post_video = get_post_meta($post->ID, "main_video", true);
       
    89                  ?>	
       
    90                         <div class="post">
       
    91 							<div class="feature-title">
       
    92                             	<h4 class="date"><?php echo date('d M Y', strtotime($post-> post_date)); ?></h4>
       
    93 	                            <h2 class="title"><a href="<?php echo $link; ?>"><?php the_title(); ?></a></h2>
       
    94 							</div>
       
    95                             <?php if($get_post_video !== "" || $get_thumbnail !== "") : ?>
       
    96                                 <div class="container-header-light-dark"><span></span></div>
       
    97                                 <div class="copy clearfix">
       
    98                                     <?php if($get_post_video !== "") :
       
    99                                         $get_post_video = preg_replace("/(width\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 940 $2 wmode=\"transparent\" ", $get_post_video);
       
   100                                         $get_post_video = preg_replace("/(height\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 480 $2", $get_post_video);
       
   101                                    ?>
       
   102                                         <div class="media">
       
   103                                             <?php echo $get_post_video; ?>
       
   104                                         </div>
       
   105                                     <?php elseif ($get_thumbnail !== "") :  ?>
       
   106                                         <div class="media"><img src="<?php bloginfo('template_directory'); ?>/functions/timthumb.php?src=<?php echo $get_thumbnail ?>&amp;w=940&amp;h=&amp;zc=1" alt="<?php the_title(); ?>" />
       
   107                                         </div>
       
   108                                     <?php endif; ?>
       
   109                                 </div>
       
   110                                 <div class="container-footer-light-dark"><span></span></div>
       
   111 							<?php endif; ?>
       
   112                         </div>
       
   113                 <?php endwhile; endif; ?>
       
   114             <?php elseif(is_front_page() && is_active_sidebar(1)) :
       
   115                 if (function_exists('dynamic_sidebar') && dynamic_sidebar(1) );
       
   116             endif; ?>
       
   117         </div>
       
   118     </div>
       
   119 <div id="content-container">