Advertisement
Guest User

Portfolio query

a guest
Dec 14th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2.             $portquery = array( 'post_type' => 'portfolio', 'posts_per_page' => 5 );
  3.             $portfeature = new WP_Query($portquery);
  4.             ?>
  5.  
  6.                     <ul class="grid cs-style carousel elastislide-list">
  7.                         <?php while ($portfeature->have_posts()) : $portfeature->the_post(); ?>
  8.                         <?php if ( has_post_thumbnail() ) : ?>
  9.                         <li>
  10.                             <figure>
  11.                                 <?php $imgurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
  12.                                 <a href="<?php echo $imgurl; ?>" title="<?php printf( __('Permalink to %s', 'zanoi'), the_title_attribute('echo=0') ) ?>" rel="lightbox" class="thumb"><?php the_post_thumbnail('thumbnail'); ?></a>
  13.                                 <figcaption>
  14.                                     <h3><?php the_title(); ?></h3>
  15.                                     <span>
  16.                                         <?php printf( __( '<span aria-hidden="true" class="icon-folder"></span> %s', 'zanoi' ), get_the_category_list(', ') ) ?>
  17.                                     </span>
  18.                                     <a href="<?php the_permalink(); ?>" class="more"><?php _e( 'Read More', 'zanoi' ) ?></a>
  19.                                 </figcaption>
  20.                             </figure>
  21.                         </li>
  22.                         <?php endif; ?>
  23.                        
  24.                     <?php endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement