Tahir-Support

Glisseo - archive.php

Apr 16th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.34 KB | None | 0 0
  1. <?php
  2. //Post ID
  3. global $wp_query;
  4. $content_array = $wp_query->get_queried_object();
  5. if(isset($content_array->ID)){
  6. $post_id = $content_array->ID;
  7. }
  8. else $post_id=0;
  9.  
  10. $template_uri = get_template_directory_uri();
  11.  
  12. //Language Options
  13. $tb_glisseo_readmore = __('Read More', 'tb_glisseo');
  14. $tb_glisseo_sharethis = __('Share This', 'tb_glisseo');
  15. $tb_glisseo_archive = __('Archive', 'tb_glisseo');
  16. $tb_glisseo_tags = __('Tag Archive', 'tb_glisseo');
  17. $tb_glisseo_category = __('Category', 'tb_glisseo');
  18.  
  19. //Page Options
  20. if(have_posts()) $pageoptions = getOptions();
  21.  
  22. //Theme Options
  23. $tb_themeoptions = array_merge(get_option("tb_glisseo_theme_general_options"),get_option("tb_glisseo_theme_header_options"),get_option("tb_glisseo_theme_body_options"),get_option("tb_glisseo_theme_blog_options"),get_option("tb_glisseo_theme_portfolio_options"));
  24.  
  25. //Page Head Area
  26. if(isset($pageoptions['tb_glisseo_activate_page_title'])){
  27. $headline = false;
  28. }
  29. else {
  30. $headline = true;
  31. //Headline
  32. $htitle = isset($pageoptions["tb_glisseo_page_head_alternative_title"]) ? $pageoptions['tb_glisseo_page_head_alternative_title'] : get_the_title();
  33. //Head Image
  34. if(!empty($pageoptions["tb_glisseo_page_head_image"])){
  35. $himage = wp_get_attachment_image_src($pageoptions["tb_glisseo_page_head_image"],'full');
  36. $himage = $himage[0];
  37. }
  38. else {
  39. $himage = $tb_themeoptions["tb_glisseo_body_head_image"];
  40. }
  41. }
  42.  
  43. get_header();
  44. ?>
  45. <?php
  46.  
  47. if(is_archive()){
  48. $htitle = __("Archive","tb_glisseo")." ".get_the_date('M. Y');
  49. }
  50.  
  51. if(is_tag()){
  52. $htitle = __("Tag Archive ","tb_glisseo")."'".get_query_var('tag')."'";
  53. }
  54.  
  55. if(is_category()){
  56. $current_cat = get_the_category();
  57. $htitle = __("Category","tb_glisseo")." '".$current_cat[0]->cat_name."'";
  58. }
  59.  
  60. if(isset($wp_query->query_vars['taxonomy']) && taxonomy_exists($wp_query->query_vars['taxonomy'])) {
  61. $value = get_query_var($wp_query->query_vars['taxonomy']);
  62. if (term_exists($wp_query->query_vars['term'])) {
  63. $term = get_term_by( 'slug', get_query_var( 'term' ),$wp_query->query_vars['taxonomy'] );
  64. $htitle = $term->name;
  65. }
  66. }
  67.  
  68. ?>
  69.  
  70.  
  71. <!-- Begin Head Image -->
  72. <div class="head-image">
  73. <?php if($headline){?>
  74. <?php if(!empty($himage)){ ?><img src="<?php echo $himage; ?>" alt="" /><?php } ?>
  75. <div class="page-title">
  76. <h1><?php echo $htitle; ?></h1>
  77. </div>
  78. <?php } ?>
  79. </div>
  80. <!-- End Head Image -->
  81.  
  82. <?php if(is_tax()):
  83. $args=array(
  84. 'category_gallery' => get_query_var( 'term' ),
  85. 'post_type' => 'gallery',
  86. 'post_status' => 'publish',
  87. 'posts_per_page' => -1
  88. );
  89. $my_query = null;
  90. $my_query = new WP_Query($args);
  91. ?>
  92. <!-- Begin Wrapper -->
  93. <div class="wrapper">
  94. <div class="intro uppercase center"><?php echo $term->description; ?></div>
  95. <!-- Begin Container -->
  96. <div class="container">
  97.  
  98. <!-- Begin Gallery Content -->
  99. <div class="content single-portfolio-content">
  100. <?php if($my_query->have_posts()) :
  101. while($my_query->have_posts()) : $my_query->the_post();
  102. echo '<div><img src='.wp_get_attachment_url( get_post_thumbnail_id($post->ID)).'>';
  103. if(strlen(get_the_content()))
  104. echo '<span class="caption"><p>'.get_the_content().'</p></span>';
  105. echo '</div>';
  106. endwhile; //have_posts
  107. else : ?>
  108. <div>
  109. <p><?php _e('Oops, we could not find what you were looking for...', 'tb_glisseo'); ?></p>
  110. </div>
  111. <?php endif; ?>
  112. </div>
  113. <!-- End Container -->
  114. </div></div>
  115. <!-- End Wrapper -->
  116. <?php endif; //is_tax ?>
  117.  
  118. <?php if(is_archive() && !is_tax()):
  119. wp_link_pages();
  120. $htitle = __('Archive', 'tb_glisseo');
  121. //$pageoptions["tb_glisseo_blog_display_type"]="columns";
  122. ?>
  123. <!-- Begin Wrapper -->
  124. <div class="wrapper">
  125. <div class="intro uppercase center"><?php echo $pageoptions["tb_glisseo_page_intro"];?></div>
  126. <?php //Checking if Style Columns or Full ?>
  127. <?php if (!isset($pageoptions["tb_glisseo_blog_display_type"]) || $pageoptions["tb_glisseo_blog_display_type"]!="columns"){ ?>
  128. <!-- Begin Container -->
  129. <div class="container">
  130.  
  131. <?php if(isset($pageoptions["tb_glisseo_sidebar"]) && $pageoptions["tb_glisseo_sidebar"]!="nosidebar"){ ?>
  132. <!-- Begin Content -->
  133. <div class="content">
  134. <?php } //Sidebar ?>
  135.  
  136. <?php }
  137. else{
  138. ?>
  139. <!-- Begin Posts Grid -->
  140. <div class="grid-wrapper">
  141. <!-- Begin Content -->
  142. <div class="content">
  143. <div class="posts-grid">
  144. <?php } ?>
  145.  
  146. <?php while (have_posts()) : the_post(); ?>
  147. <?php
  148. //Post Infos
  149. $post_time_day = get_post_time('j', true);
  150. $post_time_month = get_post_time('M', true);
  151.  
  152. $postoptions = getOptions($post->ID);
  153.  
  154. //Checking if Style Columns or Full
  155. if (!isset($pageoptions["tb_glisseo_blog_display_type"]) || $pageoptions["tb_glisseo_blog_display_type"]!="columns"){
  156. //Post Type related Object to display in the Head Area of the post
  157. $post_top="";
  158. if(isset($postoptions["tb_glisseo_post_type"]))
  159. switch ($postoptions["tb_glisseo_post_type"]) {
  160. case 'image':
  161. $blogimageurl = aq_resize(wp_get_attachment_url( get_post_thumbnail_id($post->ID) ),960);
  162. $post_top = '<a href="'.get_permalink().'"><img src="'.$blogimageurl.'" alt=""></a>';
  163. break;
  164. case 'video':
  165. if($postoptions["tb_glisseo_video_type"]=="youtube"){
  166. $post_top = '<iframe src="http://www.youtube.com/embed/'.$postoptions["tb_glisseo_youtube_id"].'?hd=1&amp;wmode=opaque&amp;autohide=1&amp;showinfo=0" width="'.$postoptions["tb_glisseo_video_width"].'" height="'.$postoptions["tb_glisseo_video_height"].'" style="border:0"></iframe>';
  167. }
  168. elseif ($postoptions["tb_glisseo_video_type"]=="vimeo") {
  169. $post_top = '<iframe src="http://player.vimeo.com/video/'.$postoptions["tb_glisseo_vimeo_id"].'?portrait=0&amp;title=0&amp;byline=0&amp;color='.$tb_themeoptions["tb_glisseo_highlight_color"].'" width="'.$postoptions["tb_glisseo_video_width"].'" height="'.$postoptions["tb_glisseo_video_height"].'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
  170. }
  171. elseif ($postoptions["tb_glisseo_video_type"]=="webm") {
  172. $post_top_width = 960;
  173. $video_width = $postoptions["tb_glisseo_video_width"];
  174. $video_height = $postoptions["tb_glisseo_video_height"];
  175.  
  176. if($video_width>$post_top_width)
  177. $video_width_ratio = $video_width/$post_top_width;
  178. else
  179. $video_width_ratio = $post_top_width/$video_width;
  180.  
  181. $video_height = round($video_height*$video_width_ratio);
  182. $video_width = $post_top_width;
  183.  
  184. $post_top = '
  185. <div class="html5video tb-resizemedia" data-width="'.$video_width.'" data-height="'.$video_height.'" style="max-width:'.$post_top_width.'px;"><iframe style="border:0;overflow:hidden;width:100%;max-width:'.$post_top_width.'px;height:'.$video_height.'px;margin-bottom: -6px;" src="'.$template_uri.'/functions/video.php?post_id='.$post->ID.'&amp;width='.$video_height.'&amp;height='.$video_height.'"></iframe></div>';
  186. }
  187. break;
  188. case 'slider':
  189. if(get_revslider_property($postoptions["tb_glisseo_slider"],'slider_type')=="fullwidth")
  190. echo '<style>.featured .fullwidthabanner{height:'.get_revslider_property($postoptions["tb_glisseo_slider"],'height').'px;}</style>';
  191.  
  192. $post_top = do_shortcode('[rev_slider '.$postoptions["tb_glisseo_slider"].']');
  193. break;
  194. case 'audio':
  195. $uniq = uniqid("audio_");
  196. $post_top = '<div class="html5audio"><audio id="'.$uniq.'" src="'.$postoptions["tb_glisseo_audio_link"].'" controls="controls"></audio></div>
  197. <script>
  198. jQuery(document).ready(function(){
  199. jQuery("#'.$uniq.'").mediaelementplayer({
  200. pluginPath: "'.TB_JS.'/mediaplayer/",
  201. // name of flash file
  202. flashName: "flashmediaelement.swf",
  203. // name of silverlight file
  204. silverlightName: "silverlightmediaelement.xap",
  205. success: function(player, node) {
  206. jQuery("#" + node.id + "-mode").html("mode: " + player.pluginType);
  207. }
  208. });
  209. });
  210. </script>
  211. ';
  212. break;
  213. default:
  214. $post_top = "";
  215. break;
  216. }
  217. }
  218. else{
  219. $blogimageurl = aq_resize(wp_get_attachment_url( get_post_thumbnail_id($post->ID) ),370,190,true);
  220. $post_top = '<a href="'.get_permalink().'"><img src="'.$blogimageurl.'" alt=""></a>';
  221. }
  222. //Categories
  223. $category_links = "";
  224. foreach((get_the_category()) as $category) {
  225. $category_links .= ', <a href="'.get_category_link($category->term_id ).'">'.$category->cat_name.'</a>';
  226. }
  227. $category_links = substr($category_links, 2);
  228. ?>
  229. <?php //Checking if Style Columns or Full ?>
  230. <?php if (!isset($pageoptions["tb_glisseo_blog_display_type"]) || $pageoptions["tb_glisseo_blog_display_type"]!="columns"){ ?>
  231. <!-- Begin Post Full -->
  232. <div id="post-<?php the_ID(); ?>" <?php post_class('post clearfix'); ?>>
  233. <div class="featured"><?php echo $post_top; ?></div>
  234. <div class="info">
  235. <div class="date">
  236. <div class="day"><?php echo $post_time_day; ?></div>
  237. <div class="month"><?php echo $post_time_month; ?></div>
  238. </div>
  239. <?php if(isset($tb_themeoptions["tb_glisseo_heart"])) echo getPostLikeLink(get_the_ID());?>
  240. </div>
  241. <div class="post-content">
  242. <h2 class="title"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
  243. <div class="meta"> <?php echo $category_links; ?> <span>|</span> <span class="comments"><?php comments_popup_link(__("0 Comments","tb_glisseo"), __("1 Comment","tb_glisseo"), '% '.__("Comments","tb_glisseo")); ?></span> </div>
  244. <?php the_excerpt(); ?></div>
  245. </div>
  246. <!-- End Post Full -->
  247. <?php }
  248. else{
  249. ?>
  250. <!-- Begin Post Columns -->
  251. <div id="post-<?php the_ID(); ?>" <?php post_class('post clearfix'); ?>>
  252. <div class="info">
  253. <div class="date">
  254. <div class="day"><?php echo $post_time_day; ?></div>
  255. <div class="month"><?php echo $post_time_month; ?></div>
  256. </div>
  257. <?php if(isset($tb_themeoptions["tb_glisseo_heart"])) echo getPostLikeLink(get_the_ID());?>
  258. </div>
  259. <div class="post-content">
  260. <div class="featured"><?php echo $post_top; ?></div>
  261. <h2 class="title"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
  262. <?php the_excerpt(); ?>
  263. <div class="meta"> <?php echo $category_links; ?> <span>|</span> <span class="comments"><?php comments_popup_link(__("0 Comments","tb_glisseo"), __("1 Comment","tb_glisseo"), '% '.__("Comments","tb_glisseo")); ?></span> </div>
  264. </div>
  265. </div>
  266. <!-- End Post Columns-->
  267. <?php } ?>
  268. <?php endwhile; ?>
  269.  
  270. <!-- Begin Page Navi -->
  271. <?php if(function_exists('pagination')){ pagination(); }else{ paginate_links(); } ?>
  272. <!-- End Page Navi -->
  273. <?php if(isset($pageoptions["tb_glisseo_blog_display_type"]) && $pageoptions["tb_glisseo_blog_display_type"]=="columns"){ ?></div><?php } //End Post Column ?>
  274.  
  275. <?php if(isset($pageoptions["tb_glisseo_sidebar"]) && $pageoptions["tb_glisseo_sidebar"]!="nosidebar"):?>
  276. <!-- Begin Content -->
  277. </div><!-- End Content -->
  278. <div class="sidebar">
  279. <!-- Begin Sidebar -->
  280. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($pageoptions["tb_glisseo_sidebar"]) ) : ?>
  281.  
  282. <div class="sidebox">
  283. <h3>Sidebar Widget</h3>
  284. Please configure this Widget Area in the Admin Panel under Appearance -> Widgets
  285. </div>
  286. <?php endif; ?>
  287. </div>
  288. <div class="clear"></div>
  289. <!-- End Sidebar -->
  290. <?php endif; //Sidebar ?>
  291.  
  292. </div>
  293. <!-- End Post Grid / Container -->
  294.  
  295. </div>
  296. <!-- End Wrapper -->
  297. <?php endif; //is_archive ?>
  298.  
  299. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment