/ Published in: PHP
This will fetch the custom post types, displayed as a list with their respective permalinks.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php query_posts( 'post_type=work&posts_per_page=1'.'&paged='.$paged); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <li class="illustrations"> <?php the_title('<h4 class="nice-titles"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h4>' ); ?> <?php if(has_post_thumbnail()) { the_post_thumbnail(); } else { echo '<img src="'.get_bloginfo("template_url").'/images/default_img.jpg" />'; } ?> <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">More...</a> </li> <!-- /item --> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div> </div> <?php else: ?> <p><?php _e('Not Found','ivorpad'); ?></p> <?php endif; ?>