WordPress: output custom post type not displaying

WordPress: output custom post type not displaying

I'm trying to output a custom post type but nothing shows up. The code is very simple - what could I be missing?

<?php $favorites = new WP_Query(array('post_type' => 'favorites', 'posts_per_page' => 10));  while ($favorites->have_posts()) : $favorites->the_post();  echo '<li><a href="' . bloginfo('template_directory') . the_post_thumbnail('large') . '" rel="thumbnail" title="&lt;a href=\'' .   simple_fields_get_post_value(get_the_id(), array(8, 3), true) . '\'&gt;' . the_title() . '&lt;/a&gt;"><img class="rounded" src="' . bloginfo('template_directory') .     the_post_thumbnail(array(101,99)) . '" alt="' . the_title() . '" /></a></li>';  endwhile; ?> 

What's the best method of displaying a custom post type featured post/page in WordPress?


WordPress 3.0.1 Query Custom Post Type with Custom Taxonomy
Have you checked that;. Best place / file to place rewrite_rules_array hook
  • You have definitely registered a post type called favorites (note plural)
  • The browser is not choking on your markup (your HTML is invalid - for starters, you should wrap list items in a <ul>
  • The function simple_fields_receive _post_value() exists and is working correctly
What is a good way to set up a dev, staging and production workflow with wordpress

78 out of 100 based on 63 user ratings 538 reviews