Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to fetch all posts which has been tagged with particulars tags.here is code i am trying to use

$args=array(  
    'tag_slug__and' => $categories_array,
    'posts_per_page'=>10, // Number of related posts to display.  
    'caller_get_posts'=>1  
);

I also tried this way

$args=array(  
    'tag_slug__and' => array('hill-station','honeymoon'),
    'posts_per_page'=>10, // Number of related posts to display.  
    'caller_get_posts'=>1  
);

$query = new wp_query( $args );

I have cross checked my data and there are 2 posts which have tags 'hill-station','honeymoon' beside others, but $query has no result.

if I use only one value under tag_slug__and like hill-station or honeymoon, i am able to see results.

Is there something i am doing wrong here or i have misunderstood the way tag_slug__and work in wordpress

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.