Advertisement
Guest User

Untitled

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