Advertisement
BakerMan

Alt tpl 2 col home

Oct 22nd, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.58 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Home Page 2 Columns with Sidebar
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.            
  9.             <!-- BEGIN #primary .hfeed-->
  10.             <div id="primary" class="hfeed clearfix isotope-container">        
  11.  
  12.             <?php
  13.             if ( get_query_var('paged') ) {
  14.                 $paged = get_query_var('paged');
  15.             } elseif ( get_query_var('page') ) {
  16.                 $paged = get_query_var('page');
  17.             } else {
  18.                 $paged = 1;
  19.             }
  20.  
  21.             /*$temp = $wp_query;
  22.             $wp_query= null;*/
  23.  
  24.             $custom_query = new WP_Query( array(
  25.                 'post_type' => 'post',
  26.                 'paged' => $paged
  27.             ) );
  28.  
  29.             // enable use of more tag on template page  
  30.             global $more; $more = 0;
  31.                            
  32.             while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
  33.            
  34.             <?php zilla_post_before(); ?>
  35.             <!-- BEGIN .hentry -->
  36.             <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">              
  37.             <?php zilla_post_start(); ?>
  38.            
  39.             <?php
  40.                 $format = get_post_format();
  41.                 $format = ($format) ? $format : 'standard';
  42.                                    
  43.                 get_template_part( 'content', $format);
  44.                
  45.                 if( $format == 'standard' || $format == 'gallery' || $format == 'video' || $format == 'audio' ) {
  46.                     get_template_part( 'content', 'meta' );
  47.                 }
  48.             ?>
  49.                                
  50.             <?php zilla_post_end(); ?>
  51.             <!-- END .hentry-->  
  52.             </div>
  53.             <?php zilla_post_after(); ?>
  54.  
  55.             <?php endwhile; ?>
  56.                
  57.             <?php
  58.             $pagination = zilla_get_option('post_pagination_type');
  59.             // force pagination in Opera
  60.             global $is_opera;
  61.             if( $pagination == 'loadmore' && !$is_opera ) {
  62.                 if( $custom_query->max_num_pages > 1 ) { ?>
  63.                     <a href="#" id="load-more" data-width="260"><?php _e('Load More', 'zilla'); ?></a>
  64.                 <?php }
  65.             } else { ?>
  66.                 <!-- BEGIN .navigation .page-navigation -->
  67.                 <div class="navigation page-navigation">
  68.                     <div class="nav-next">
  69.                         <?php next_posts_link(__('Older Entries', 'framework')); ?>
  70.                     </div>
  71.                     <div class="nav-previous">
  72.                         <?php previous_posts_link(__('Newer Entries', 'framework')) ?>
  73.                     </div>
  74.                 <!-- END .navigation .page-navigation -->
  75.                 </div>
  76.             <?php } ?>
  77.                        
  78.                 <!-- END #primary .hfeed .isotope-container -->
  79.                 </div>
  80.  
  81.  
  82.  
  83.             <?php get_sidebar(); ?>
  84.             </div>
  85.            
  86.             <?php /*$wp_query = null; $wp_query = $temp;*/ ?>
  87.             <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement