i have a custom post type category and its name is donations and donations category has 50 posts. now i want to fetch all those posts any help?
i want to show on template page, name is /Template Name: Help Donations/
i try all of this but its not working for me.
<?php query_posts('category_name=donations&post_type=help'); ?>
<?php while(have_posts()): the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
also this one too is not working.
<?php $the_query = new WP_Query('category_name=donations&post_type=help'); ?>
<?php while($the_query->have_posts()): $the_query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
Try this. You may need to change the taxonomy name. I just assumed that you named it
post_type_category
. So this is to get all post_types with the namehelp
that has thepost_type_category
with the namedonations
.