Staffan Estberg
Staffan Estberg

Reputation: 7025

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;
?>

Upvotes: 0

Views: 943

Answers (1)

TheDeadMedic
TheDeadMedic

Reputation: 9997

Have you checked that;

  • 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_get_post_value() exists and is working correctly

Upvotes: 2

Related Questions