Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <section class="row main_content">
- <!--This is the section with the hero content and uses the "push-pull" styles to reorder the divs on mobile devices -->
- <div class="small-12 large-4 large-push-8 columns">
- <?php get_sidebar( $name ); ?>
- </div>
- <!-- This is the Main image post -->
- <div class="hero">
- <div class="small-12 large-8 large-pull-4 columns">
- <!-- /////////////////////-Start of THE LOOP-\\\\\\\\\\\\\\\\\\\\\-->
- <?php
- $args = array( 'post_type' => 'blog',
- 'post_status' => 'publish',
- 'showposts' => 1,
- '&paged='.$paged);
- $featuredPost = new WP_Query($args); //This is a global query
- if ($featuredPost->have_posts()) :
- while ($featuredPost->have_posts()) : $featuredPost->the_post();
- ?>
- <!--Start of the FEATURED post image-->
- <div class="hero_img"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('blog-featured-img'); ?></a></div>
- <!--End of the FEATURED post image-->
- <div class="thumbpost-text">
- <h2 class="thumbpost-titles"><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></h2>
- <p class="thumbpost-tags"><?php the_tags( "", ", ", "" ); ?></p>
- </div>
- <?php
- endwhile;
- else : ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
- <?php endif;
- ?>
- <!--/////////////////////-End of THE FIRST LOOP-\\\\\\\\\\\\\\\\\\\\\-->
- <?php rewind_posts(); ?>
- </div>
- </div>
- <!-- End of the Main image post -->
- </section>
- <?php
- wp_reset_query();
- if ( $featuredPost->is_home() ) {
- // This is a homepage
- // Do your fancy loop here with extra bells and whistles
- get_template_part('content');
- } else {
- // This is not a homepage (i.e. paginated page)
- // Do a stripped down version of your loop above with no bells and whistles
- }
- ?>
- <div class="row subcontent">
- <div class="small-12 medium-12 large-12 columns">
- <?php // save the original $wp_query object
- $temp = $wp_query;
- // create a new $wp_query object
- $wp_query = new WP_Query($args);
- while($wp_query->have_posts()): $wp_query->the_post();
- // output your data here
- endwhile;
- // display previous and next links
- previous_posts_link('Newer');
- next_posts_link('Older');
- // restore the global $wp_query object
- $wp_query = $temp; ?>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement