Advertisement
Guest User

Untitled

a guest
Sep 8th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.07 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Case Studies
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.                    <?php  $query = new WP_Query();
  9.                    $query = new WP_Query( array('post_type' => 'case-studies', 'paged' => get_query_var('paged') ) );
  10.                    $query->query('post_type=case-studies&posts_per_page=4');
  11.                    ?>
  12.  
  13.             <!--BEGIN #primary .hfeed-->
  14.             <div class="hfeed">
  15.  
  16.                 <!--BEGIN #columns-wrap-->
  17.                 <ul>
  18.  
  19.                     <?php $count = 1; ?>
  20.                     <?php $odd_or_even = 'odd'; ?>
  21.                     <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
  22.                           ?>
  23.  
  24.                     <li data-id="id-<?php echo $count; ?>" class="<?php echo $odd_or_even; ?>">
  25.                     <?php
  26. if ('odd' == $odd_or_even){
  27.   $odd_or_even = 'even';
  28. }else{
  29.   $odd_or_even = 'odd';
  30. }
  31. ?>
  32.                         <!--BEGIN .hentry -->
  33.                         <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">  
  34.  
  35.                             <?php /* if the post has a WP 2.9+ Thumbnail */
  36.                             if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
  37.                             <div class="post-thumb">
  38.                                 <a title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('case-study'); /* post thumbnail settings configured in functions.php */ ?></a>
  39.                             </div>
  40.                             <?php } ?>
  41.  
  42.                             <div class="entry-wrapper"><h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>"> <?php the_title(); ?></a> <?php edit_post_link( __('edit', 'framework'), '<span class="edit-post">[', ']</span>' ); ?></h2>
  43.  
  44.                             <!--BEGIN .entry-content -->
  45.                             <div class="entry-content">
  46.  
  47.                                 <?php the_excerpt(); ?>
  48.                                 <a href="<?php the_permalink(); ?>" class="more-link"><?php _e('Read more...', 'framework'); ?></a>
  49.  
  50.                             <!--END .entry-content -->
  51.                             </div>
  52.                             </div>
  53.  
  54.                         <!--END .hentry-->
  55.                         </div>
  56.  
  57.                     </li><hr />
  58.                     <?php $count++; ?>
  59.                     <?php endwhile; endif; ?>
  60.  
  61.                     <?php wp_reset_query(); ?>
  62.  
  63.                 <!--END #one-columns-->
  64.                 </ul>
  65. <!--BEGIN .navigation .page-navigation -->
  66.  
  67.             <div class="navigation page-navigation">
  68.                 <?php if(function_exists('wp_pagenavi')) { wp_pagenavi( array( 'query' => $query ) ); } else { ?>
  69.                 <div class="nav-next"><?php next_posts_link() ?></div>
  70.                 <div class="nav-previous"><?php previous_posts_link() ?></div>
  71.                 <?php } ?>
  72.             <!--END .navigation .page-navigation -->
  73.             </div>
  74.             <!--END #portfolio-wrap-->
  75.             </div>
  76.  
  77. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement