custom post_type loop
-
Hi,
I have a custom “post_type” called cities and need to loop through all the cites, outputting name, thumbnail and excerpt. I have the following but its not working..
<?php $args = array('post_type' => 'cities', 'depth' => 1, 'orderby' => 'name', 'posts_per_page' => 20, 'post_status' => 'publish'); $loop = new WP_Query($args); wp_list_pages($args); if($loop->have_posts()){ while ($loop->have_posts()) : $loop->the_post(); ?> <li> <a href='<?php the_permalink() ?>' rel='bookmark' title='<?php the_title_attribute(); ?>'> <?php the_title(); ?> </a> <?php the_excerpt() ?> <?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?> </li> <?php endwhile; } //if ($my_query) wp_reset_query();*/ ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘custom post_type loop’ is closed to new replies.