Advertisement
Guest User

Index

a guest
Jan 25th, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.41 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <section class="row main_content">
  3. <!--This is the section with the hero content and uses the "push-pull" styles to reorder the divs on mobile devices -->
  4.     <div class="small-12 large-4 large-push-8 columns">
  5.         <?php get_sidebar( $name ); ?>
  6.     </div>     
  7.  
  8. <!-- This is the Main image post -->
  9.     <div class="hero"> 
  10.         <div class="small-12 large-8 large-pull-4 columns">
  11.  
  12.             <!-- /////////////////////-Start of THE LOOP-\\\\\\\\\\\\\\\\\\\\\-->
  13.             <?php
  14.             $args = array( 'post_type' => 'blog',
  15.                            'post_status' => 'publish',
  16.                            'showposts' => 1,
  17.                            '&paged='.$paged);
  18.             $featuredPost = new WP_Query($args); //This is a global query
  19.            
  20.             if ($featuredPost->have_posts()) :
  21.            
  22.             while ($featuredPost->have_posts()) : $featuredPost->the_post();
  23.             ?>
  24.            
  25.             <!--Start of the FEATURED post image-->
  26.             <div class="hero_img"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('blog-featured-img'); ?></a></div>
  27.             <!--End of the FEATURED post image-->
  28.  
  29.             <div class="thumbpost-text">
  30.                 <h2 class="thumbpost-titles"><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></h2>
  31.                 <p class="thumbpost-tags"><?php the_tags( "", ", ", "" ); ?></p>
  32.             </div>
  33.             <?php
  34.            
  35.             endwhile;
  36.             else : ?>
  37.                 <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
  38.             <?php endif;
  39.              ?>
  40.             <!--/////////////////////-End of THE FIRST LOOP-\\\\\\\\\\\\\\\\\\\\\-->
  41.             <?php rewind_posts(); ?>
  42.         </div>
  43.     </div>
  44. <!-- End of the Main image post -->
  45.    
  46. </section>
  47.  
  48.  
  49. <?php
  50. wp_reset_query();
  51.  
  52. if ( $featuredPost->is_home() ) {
  53.     // This is a homepage
  54.     // Do your fancy loop here with extra bells and whistles
  55.     get_template_part('content');      
  56. } else {
  57.     // This is not a homepage (i.e. paginated page)
  58.     // Do a stripped down version of your loop above with no bells and whistles
  59. }
  60. ?>
  61.  
  62.    
  63. <div class="row subcontent">
  64.     <div class="small-12 medium-12 large-12 columns">
  65.             <?php // save the original $wp_query object
  66.             $temp = $wp_query;
  67.             // create a new $wp_query object
  68.             $wp_query = new WP_Query($args);
  69.             while($wp_query->have_posts()): $wp_query->the_post();
  70.             // output your data here
  71.             endwhile;
  72.             // display previous and next links
  73.             previous_posts_link('Newer');
  74.             next_posts_link('Older');
  75.             // restore the global $wp_query object
  76.             $wp_query = $temp; ?>
  77.            
  78.     </div>
  79. </div>
  80.  
  81. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement