Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Projects
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.  
  9. <div id="content">
  10.     <div id="contentwide">
  11.         <div class="postarea_wide">
  12.  
  13.  
  14.         <?php
  15.         /*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
  16.         $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
  17.         $query = new WP_Query( array ( 'category_name' => 'decorating-home', 'posts_per_page' => 9, 'paged' => $paged ) );
  18.  
  19.  
  20.         if($query->have_posts()) :  while($query->have_posts()) :  $query->the_post();
  21.         ?>
  22.             <div class="proj">
  23.                             <div class="postimage">
  24.                                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('project-thumb'); ?></a>
  25.                             </div>
  26.                             <div class="proj-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
  27.             </div>
  28.         <?php      
  29.             if(($query->current_post+1)%3 == 0){
  30.                 echo '<div class="clear" style="clear:left"></div>';
  31.             }
  32.         ?>
  33.        
  34.         <?php endwhile; else: ?>
  35.  
  36.         <p><?php _e("Sorry, no posts matched your criteria."); ?></p>
  37.  
  38.         <?php endif; ?>
  39.        
  40.        <div id="pagenav">
  41.             <div class="prev"><p><?php previous_posts_link(); ?></p></div>
  42.             <div class="next"><p><?php next_posts_link(); ?></p></div>
  43.         </div>
  44.  
  45.  
  46.  
  47.         </div>
  48.     </div>
  49. </div>
  50.  
  51. <!-- The main column ends  -->
  52.  
  53. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement