Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: index
- */
- ?>
- <?php get_header(); ?>
- <div class = "con-main">
- <div class = "left">
- <!-- <div id = "entry-two-column"> -->
- <?php $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; ?>
- <?php $args = array( 'posts_per_page' => 7, 'paged' => $paged,'orderby' => 'date' ); ?>
- <?php global $wp_query, $wp_the_query; ?>
- <?php $wp_query = new WP_Query( $args ); ?>
- <?php $count_posts = $wp_query->found_posts;
- $counter = 1;
- ?>
- <?php if( $wp_query->have_posts() ) : while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
- <?php
- //Check for the 5th, 6th and 7th blog post on home and category page
- if( ($counter % 7 == 5) || ($counter % 7 == 6) || ($counter % 7 == 0)) {
- ?>
- <div class="entry-three-column entry">
- <div class="entry-image-three-col">
- <?php
- if ( has_post_thumbnail() ) {
- the_post_thumbnail('smaller');
- }
- ?>
- </div>
- <div class="entry-title">
- <h2>
- <a href="<?php the_permalink(); ?>" class = "index_blog_title" title="<?php _e('Permalink to ', 'kelle'); ?><?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h2>
- </div>
- <div class="entry-excerpt">
- <p> <?php the_excerpt(); ?> </p>
- </div>
- <div class="read-more">
- <a href="<?php echo get_permalink(); ?>">READ MORE</a>
- <div class="hidden-like" id="post-<?=$wp_query->posts[0]->ID;?>-like">
- <?php //pinboard_social_bookmarks();
- echo do_shortcode('[ssba]');
- ?>
- </div> <!--hidden-like end -->
- </div> <!-- read-more end -->
- <div class = "thumb">
- <img src="http://localhost/wp_the_vitality_project/wp-content/uploads/2014/10/fb_thumb.jpg" class = "thumbup">
- </div>
- </div> <!-- entry-three-column end-->
- <?php
- } else {
- ?>
- <div class="entry-two-column entry">
- <div class="entry-image">
- <?php
- if ( has_post_thumbnail() ) {
- the_post_thumbnail();
- }
- ?>
- </div>
- <div class="entry-title">
- <h2>
- <a href="<?php the_permalink(); ?>" class = "index_blog_title" title="<?php _e('Permalink to ', 'kelle'); ?><?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h2>
- </div>
- <div class="entry-excerpt">
- <p> <?php the_excerpt(); ?> </p>
- </div>
- <div class="read-more">
- <a href="<?php echo get_permalink(); ?>">READ MORE</a>
- <div class="hidden-like" id="post-<?=$wp_query->posts[0]->ID;?>-like">
- <?php //pinboard_social_bookmarks();
- echo do_shortcode('[ssba]');
- ?>
- </div> <!--hidden-like end -->
- </div> <!-- read-more end -->
- <div class = "thumb">
- <img src="http://localhost/wp_the_vitality_project/wp-content/uploads/2014/10/fb_thumb.jpg" class = "thumbup">
- </div>
- </div> <!-- entry-two-column end -->
- <?php
- }
- $counter++;
- ?>
- <?php endwhile; ?>
- <?php wp_pagenavi(); ?>
- </div> <!-- left end -->
- <?php else : ?>
- <?php endif; ?>
- <?php wp_reset_postdata(); ?>
- <?php $wp_query = $wp_the_query; ?>
- <div id = "sidebar">
- <?php get_sidebar(); ?>
- </div> <!-- sidebar end -->
- </div> <!-- con-main end -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement