Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.47 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: index
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.  
  9. <div class = "con-main">
  10.    
  11.     <div class = "left">
  12.  
  13.         <!-- <div id = "entry-two-column"> -->
  14.  
  15.             <?php $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; ?>
  16.             <?php $args = array( 'posts_per_page' => 7, 'paged' => $paged,'orderby' => 'date' ); ?>
  17.             <?php global $wp_query, $wp_the_query; ?>
  18.             <?php $wp_query = new WP_Query( $args ); ?>
  19.             <?php $count_posts = $wp_query->found_posts;
  20.             $counter = 1;
  21.             ?>
  22.  
  23.             <?php if( $wp_query->have_posts() ) : while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  24.  
  25.             <?php
  26.             //Check for the 5th, 6th and 7th blog post on home and category page
  27.             if( ($counter % 7 == 5) || ($counter % 7 == 6) || ($counter % 7 == 0)) {
  28.             ?>         
  29.  
  30.                 <div class="entry-three-column entry">
  31.                    
  32.                     <div class="entry-image-three-col">
  33.                         <?php
  34.                             if ( has_post_thumbnail() ) {
  35.                                 the_post_thumbnail('smaller');
  36.                             }
  37.                         ?>
  38.                     </div>
  39.  
  40.                     <div class="entry-title">
  41.                        
  42.                         <h2>
  43.                             <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>
  44.                         </h2>
  45.                    
  46.                     </div>
  47.  
  48.                     <div class="entry-excerpt">
  49.                        
  50.                         <p> <?php the_excerpt(); ?> </p>
  51.                    
  52.                     </div>
  53.  
  54.                     <div class="read-more">
  55.  
  56.                         <a href="<?php echo get_permalink(); ?>">READ MORE</a>
  57.  
  58.                         <div class="hidden-like" id="post-<?=$wp_query->posts[0]->ID;?>-like">
  59.                            
  60.                             <?php //pinboard_social_bookmarks();
  61.                                 echo do_shortcode('[ssba]');
  62.                             ?>
  63.  
  64.                         </div>  <!--hidden-like end -->
  65.  
  66.                     </div>  <!-- read-more end -->
  67.  
  68.                     <div class = "thumb">
  69.  
  70.                         <img src="http://localhost/wp_the_vitality_project/wp-content/uploads/2014/10/fb_thumb.jpg" class = "thumbup">
  71.  
  72.                     </div>
  73.  
  74.                 </div>  <!-- entry-three-column end-->
  75.  
  76.             <?php
  77.             } else {
  78.             ?>             
  79.  
  80.                 <div class="entry-two-column entry">
  81.                    
  82.                     <div class="entry-image">
  83.                         <?php
  84.                             if ( has_post_thumbnail() ) {
  85.                                 the_post_thumbnail();
  86.                             }
  87.                         ?>
  88.                     </div>
  89.  
  90.                     <div class="entry-title">
  91.                        
  92.                         <h2>
  93.                             <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>
  94.                         </h2>
  95.                    
  96.                     </div>
  97.  
  98.                     <div class="entry-excerpt">
  99.                        
  100.                         <p> <?php the_excerpt(); ?> </p>
  101.                    
  102.                     </div>
  103.  
  104.                     <div class="read-more">
  105.  
  106.                         <a href="<?php echo get_permalink(); ?>">READ MORE</a>
  107.  
  108.                         <div class="hidden-like" id="post-<?=$wp_query->posts[0]->ID;?>-like">
  109.                            
  110.                             <?php //pinboard_social_bookmarks();
  111.                                 echo do_shortcode('[ssba]');
  112.                             ?>
  113.  
  114.                         </div>  <!--hidden-like end -->
  115.  
  116.                     </div>  <!-- read-more end -->
  117.  
  118.                     <div class = "thumb">
  119.  
  120.                         <img src="http://localhost/wp_the_vitality_project/wp-content/uploads/2014/10/fb_thumb.jpg" class = "thumbup">
  121.  
  122.                     </div>
  123.  
  124.                 </div>  <!-- entry-two-column end -->
  125.  
  126.             <?php
  127.             }
  128.             $counter++;
  129.             ?>
  130.  
  131.             <?php endwhile; ?>
  132.  
  133.     <?php wp_pagenavi(); ?>    
  134.  
  135.     </div>  <!-- left end -->
  136.  
  137.     <?php else : ?>
  138.  
  139.     <?php endif; ?>
  140.  
  141.     <?php wp_reset_postdata(); ?>
  142.  
  143.     <?php $wp_query = $wp_the_query; ?>
  144.  
  145.     <div id = "sidebar">
  146.        
  147.         <?php get_sidebar(); ?>
  148.    
  149.     </div>  <!-- sidebar end -->
  150.  
  151. </div>  <!-- con-main end -->
  152.  
  153. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement