Advertisement
Guest User

Untitled

a guest
Feb 16th, 2011
987
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Projects
  4. */
  5. ?>
  6.  
  7. <?php get_header();?>
  8.  
  9.     <section id="content">
  10.         <section id="main">
  11.  
  12.             <?php
  13.                 $i=1;
  14.                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  15.                 $args=array(
  16.                     'post_type' => 'projects',
  17.                     'posts_per_page' => 4,
  18.                     'paged' => $paged
  19.                 );
  20.                 $temp = $wp_query;
  21.                 $wp_query = null;
  22.                 $wp_query = new WP_Query($args);
  23.                 while ( $wp_query->have_posts() ) : $wp_query->the_post();
  24.             ?>
  25.            
  26.             <article class="post<?php if($i%2 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>">
  27.                 <h2><?php the_title(); ?></h2>
  28.                 <section class="entry">
  29.                     <?php the_excerpt(); ?>
  30.                 </section>
  31.             </article>
  32.            
  33.             <?php
  34.                 endwhile;
  35.                 wp_pagenavi();
  36.                 $wp_query = null;
  37.                 $wp_query = $temp;
  38.                 wp_reset_query();
  39.             ?>
  40.            
  41.             <section id="map">
  42.                 <img src="<?php bloginfo('template_url') ?>/images/interactive-map.jpg" alt="Interactive Map" />
  43.             </section>
  44.         </section>
  45.  
  46. <?php get_sidebar(); ?>
  47.    
  48.     </section>
  49.    
  50. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement