I’ve got a problem with a query !
I’ve got 4 different post_type.
I would like to retrieve the posts from all post type from one category named ‘une’. But it shows only post type from two post type => spectacles and post.

Here is my code :

<?php 
query_posts(array(
'post_type' => array('post','videos','photos','spectacles'),
'showposts' => -1,
'category_name' => 'une',
)
); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>

<?php endwhile; else: ?>
<?php endif; ?>

It is like category_name doesn’t work for my query !

Thank you for helping me !

Ben

Read more here: Query one category name from multiple post type


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: