Advertisement
Guest User

archive.php

a guest
Jan 14th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.45 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php
  3.         $layout = mom_option('cat_layout');
  4.     $share = mom_option('cat_share');
  5.     if (is_category()) {
  6.         $cat_data = get_option("category_".get_query_var('cat'));
  7.         $layout = isset($cat_data['layout']) ? $cat_data['layout'] :'';
  8.         $enable_slider = isset($cat_data['slider']) ? $cat_data['slider'] :'';
  9.         if ($layout == '') {
  10.             $layout = mom_option('cat_layout');
  11.         }
  12.    
  13.         if ($enable_slider == '') {
  14.             $enable_slider = mom_option('cat_slider');
  15.         }
  16.     }
  17.     $post_count = 1;
  18.     $grid_class = '';
  19.     $ad_id = mom_option('cat_ad_id');
  20.     $ad_count = mom_option('cat_ad_count');
  21.     $ad_repeat = mom_option('cat_ad_repeat');
  22. ?>
  23.             <div class="inner">
  24.             <div class="main_container">
  25.             <div class="main-col">
  26.                 <div class="category-title">
  27.                     <?php mom_breadcrumb(); ?>
  28.                     <?php if (is_category() && mom_option('cat_rss') == 1) { ?>
  29.                     <a class="bc-rss" target="_blank" href="<?php echo esc_url(home_url()); ?>?cat=<?php echo get_query_var('cat'); ?>&feed=rss2"><i class="fa-icon-rss"></i></a>
  30.                     <?php } ?>
  31.                     <?php if (is_tag() && mom_option('cat_rss') == 1) { ?>
  32.                     <a class="bc-rss" target="_blank" href="<?php echo esc_url(home_url()); ?>?tag=<?php echo get_query_var('tag'); ?>&feed=rss2"><i class="fa-icon-rss"></i></a>
  33.                     <?php } ?>
  34.                 </div>
  35.                 <?php if(is_category() && category_description() != '') { ?>
  36.                 <div class="category-description base-box">
  37.                     <?php echo do_shortcode(category_description()); ?>
  38.                 </div>
  39.                 <?php } ?>
  40.         <?php if (is_author()) {
  41.             $bg = get_the_author_meta('ab_bg');
  42.             if ($bg == '') {
  43.                 $bg = mom_option('author_bg', 'url');
  44.             }
  45.             if ($bg != '') {
  46.                 $bg = 'style="background-image:url('.$bg.'); background-size: cover;"';
  47.             }
  48.             $layout = get_the_author_meta('ap_l');
  49.             if ($layout == '') {
  50.                 $layout = mom_option('author_layout');
  51.             }
  52.        
  53.         ?>
  54.             <div class="base-box">
  55.                 <div class="single-author-box" <?php echo $bg; ?>>
  56.                     <?php mom_author_box('min'); ?>
  57.                 </div>
  58.             </div>
  59.         <?php } ?>
  60.                
  61.                 <?php
  62.             if (is_category()) {
  63.                 if ($enable_slider == true) {
  64.                     $slider_orderby = mom_option('cat_slider_orderby');
  65.                     $slider_count = mom_option('cat_slider_count');
  66.                     $slider_timeout = mom_option('cat_slider_timeout');
  67.                     $slider_animation = mom_option('cat_slider_animation');
  68.                     $slider_speed = mom_option('cat_slider_ani_speed');
  69.                     $slider_caption_style = mom_option('cat_slider_caption_style');
  70.                     $slider_nav_style = mom_option('cat_slider_nav_style');
  71.                    
  72.                     if ($slider_orderby == 'popular') {
  73.                     $slider_orderby = 'orderby="comment_count"';
  74.                     } elseif ($slider_orderby == 'random') {
  75.                     $slider_orderby = 'orderby="rand"';
  76.                     } else {
  77.                     $slider_orderby = '';
  78.                     }
  79.                  
  80.                     echo do_shortcode('[feature_slider display="category" category="'.get_query_var('cat').'" count="'.$slider_count.'" '.$slider_orderby.' caption_style="'.$slider_caption_style.'" animation="'.$slider_animation.'" speed="'.$slider_speed.'" timeout="'.$slider_timeout.'" nav="'.$slider_nav_style.'"]');
  81.                 }
  82.             }
  83.                 ?>
  84.                
  85.             <?php if ($layout == 't') { ?>
  86.                 <div class="base-box page-wrap">
  87.         <?php
  88.         if ( is_archive() ) {
  89.         if ( is_category() || is_tag() || is_tax() ) {
  90.             $term = $wp_query->get_queried_object();
  91.             $taxonomy = get_taxonomy( $term->taxonomy );
  92.         ?>
  93.                 <h1 class="page-title"><?php echo $term->name; ?></h1>
  94.         <?php } else if (function_exists( 'is_post_type_archive' ) && is_post_type_archive()) {
  95.         $post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
  96.         ?>
  97.                 <h1 class="page-title"><?php echo $post_type_object->labels->name; ?></h1>
  98.         <?php } else if ( is_date() ) {
  99.             if ( is_day() )
  100.                 echo '<h1 class="page-title">'.__( 'Archives for ', 'theme' ) . get_the_time( 'F j, Y' ).'</h1>';
  101.             elseif ( is_month() )
  102.                 echo '<h1 class="page-title">'.__( 'Archives for ', 'theme' ) . single_month_title( ' ', false ).'</h1>';
  103.             elseif ( is_year() )
  104.                 echo '<h1 class="page-title">'.__( 'Archives for ', 'theme' ) . get_the_time( 'Y' ).'</h1>';
  105.         } ?>
  106.        
  107.         <?php } // end of archives ?>
  108.  
  109.                 <div class="entry-content">
  110.                 <?php echo mom_posts_timeline(); ?>
  111.                 </div> <!-- entry content -->
  112.                 </div> <!-- base box -->
  113.             <?php } else if ($layout == 'g') { ?>
  114.             <div class="posts-grid clearfix">
  115.                 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  116.        
  117.                         <?php
  118.                 if ($post_count%2 == 0) {
  119.                         $grid_class = 'second';
  120.                 } else {
  121.                         $grid_class = '';
  122.                 }
  123.                 mom_blog_post($layout, $share, '', $grid_class);
  124.                 if ($ad_id != '') {
  125.                         if ($ad_repeat == 1) {
  126.                                 if ($post_count%$ad_count == 0) {
  127.                                     echo do_shortcode('[ad id="'.$ad_id.'"]');
  128.                                 }
  129.                         } else {
  130.                                 if ($post_count == $ad_count) {
  131.                                     echo do_shortcode('[ad id="'.$ad_id.'"]');
  132.                                 }
  133.                         }
  134.                 }
  135.                 $post_count ++;
  136.             ?>
  137.                 <?php endwhile; ?>
  138.                 <?php  else:  ?>
  139.                 <!-- Else in here -->
  140.                 <?php  endif; ?>
  141.             </div>
  142.             <?php } else { ?>
  143.                 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  144.                         <?php
  145.             mom_blog_post($layout, $share);
  146.                 if ($ad_id != '') {
  147.                         if ($ad_repeat == 1) {
  148.                                 if ($post_count%$ad_count == 0) {
  149.                                     echo do_shortcode('[ad id="'.$ad_id.'"]');
  150.                                 }
  151.                         } else {
  152.                                 if ($post_count == $ad_count) {
  153.                                     echo do_shortcode('[ad id="'.$ad_id.'"]');
  154.                                 }
  155.                         }
  156.                 }
  157.                 $post_count ++;
  158.            
  159.             ?>
  160.                 <?php endwhile; ?>
  161.                 <?php  else:  ?>
  162.                 <!-- Else in here -->
  163.                 <?php  endif; ?>
  164.             <?php }// end if layout ?>
  165.         <?php if ($layout != 't') { mom_pagination(); } ?>
  166.             <?php wp_reset_query(); ?>
  167.             </div> <!--main column-->
  168.             <?php get_sidebar('secondary'); ?>
  169.             <div class="clear"></div>
  170. </div> <!--main container-->            
  171. <?php get_sidebar(); ?>
  172.             </div>
  173. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement