Question

I am trying to make an index page but just showing the posts of a specific custom type.

Loop starts like this:

 <?php while ( have_posts() ) : the_post() ?>

How can I modify the code just to show posts from a custom type called "classifieds"?

Thanks!

Was it helpful?

Solution

You'd be much better off creating your own query, and by-passing the post type check altogether;

query_posts('post_type=my_post_type');
while (have_posts()):
    ...
endwhile;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top