Advertisement
Guest User

Untitled

a guest
Oct 13th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.17 KB | None | 0 0
  1. <?php $mts_options = get_option('THEMENAME'); ?>
  2. <?php get_header(); ?>
  3. <div id="page">
  4.     <div class="content">
  5.         <div class="article">
  6.             <div id="content_box">
  7.                 <?php if (is_home() && !is_paged()) { ?>
  8.                     <?php if($mts_options['mts_featured_slider'] == '1') { ?>
  9.                         <div class="slider-container">
  10.                             <div class="flex-container">
  11.                                 <div id="slider" class="flexslider">
  12.                                     <ul class="slides">
  13.                                         <?php $slider_cat = implode(",", $mts_options['mts_featured_slider_cat']); $my_query = new WP_Query('cat='.$slider_cat.'&posts_per_page=4');
  14.                                             while ($my_query->have_posts()) : $my_query->the_post();
  15.                                             $image_id = get_post_thumbnail_id();
  16.                                             $image_url = wp_get_attachment_image_src($image_id,'related');
  17.                                             $image_url = $image_url[0]; ?>
  18.                                         <li data-thumb="<?php echo $image_url; ?>">
  19.                                             <a href="<?php the_permalink() ?>">
  20.                                                 <?php the_post_thumbnail('slider',array('title' => '')); ?>
  21.                                                 <div class="flex-caption">
  22.                                                     <h2 class="slidertitle"><?php the_title(); ?></h2>
  23.                                                 </div>
  24.                                             </a>
  25.                                         </li>
  26.                                         <?php endwhile; wp_reset_query(); ?>
  27.                                     </ul>
  28.                                 </div>
  29.                             </div>
  30.                         </div>
  31.                         <!-- slider-container -->
  32.                     <?php } ?>
  33.                 <?php } ?>     
  34.                 <?php $j = 0; if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; }
  35.                     if($mts_options['mts_latest_section'] == '1') {
  36.                         $latestsection = implode(",", $mts_options['mts_latest_section_cat']);
  37.                         query_posts('cat='.$latestsection.'&paged='.$paged);
  38.                     } else {
  39.                         query_posts( array( 'post_type' => 'post', 'paged' => $paged ) );
  40.                     }
  41.                     if (have_posts()) : while (have_posts()) : the_post();
  42.                     ?>
  43.                     <article class="latestPost excerpt  <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>">
  44.                         <header>
  45.                             <h2 class="title front-view-title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  46.                             <?php if($mts_options['mts_home_headline_meta'] == '1') { ?>
  47.                                 <div class="post-info">
  48.                                     <span class="theauthor"><i class="icon-user"></i> <?php  the_author_posts_link(); ?></span>  
  49.                                     <span class="thetime"><i class="icon-calendar"></i> <?php the_time( get_option( 'date_format' ) ); ?></span>  
  50.                                     <span class="thecategory"><i class="icon-tags"></i> <?php the_category(', ') ?></span>  
  51.                                     <span class="thecomment"><i class="icon-comments"></i> <a rel="nofollow" href="<?php comments_link(); ?>"><?php echo comments_number();?></a></span>
  52.                                 </div>
  53.                             <?php } ?>
  54.                         </header>
  55.                         <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="featured-thumbnail">
  56.                             <?php if ( has_post_thumbnail() ) { ?>
  57.                                 <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('featured',array('title' => '')); echo '</div>'; ?>
  58.                             <?php } else { ?>
  59.                                 <div class="featured-thumbnail">
  60.                                     <img width="223" height="137" src="<?php echo get_template_directory_uri(); ?>/images/nothumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
  61.                                 </div>
  62.                             <?php } ?>
  63.                         </a>
  64.                         <div class="front-view-content">
  65.                             <?php echo mts_excerpt(29);?>
  66.                         </div>
  67.                         <div class="readMore"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow"><?php _e('Read More','mythemeshop'); ?></a></div>
  68.                     </article><!--.post excerpt-->
  69.                 <?php endwhile; endif; ?>
  70.                 <!--Start Pagination-->
  71.                 <?php if ($mts_options['mts_pagenavigation'] == '1' ) { ?>
  72.                     <?php  $additional_loop = 0; mts_pagination($additional_loop['max_num_pages']); ?>          
  73.                 <?php } else { ?>
  74.                     <div class="pagination">
  75.                         <ul>
  76.                             <li class="nav-previous"><?php next_posts_link( __( '&larr; '.'Older posts', 'mythemeshop' ) ); ?></li>
  77.                             <li class="nav-next"><?php previous_posts_link( __( 'Newer posts'.' &rarr;', 'mythemeshop' ) ); ?></li>
  78.                         </ul>
  79.                     </div>
  80.                 <?php } ?>
  81.                 <!--End Pagination-->
  82.             </div>
  83.         </div>
  84.         <?php get_sidebar(); ?>
  85. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement