I've created this theme with some custom post types called projects and events.
I now want to link to a "archive page" all the posts with that post type. H开发者_JAVA技巧ow is that possible?
Thanks!
try wp_query class you can cusomize it with the post type. read more here http://codex.wordpress.org/Class_Reference/WP_Query#Type_.26_Status_Parameters
then you may do so with a condition to change the code in achhive page from:
if (have_posts()) : while (have_posts()) : the_post();
to:
$cat_posts = new WP_Query($query_string."post_type=projects");
if ($cat_posts->have_posts()) : while($cat_posts->have_posts()) :
$cat_posts->the_post();
精彩评论