Using an array in query_posts
-
Hi – I am using the following to generate a list of posts that have certain tags:
$query = array('cat' => '4', 'orderby' => 'rand', 'tag__in' => array(7,9))
This works great.
The problem is that I can’t seem to generate the array for tag__in dynamically. If I use an array of values ( ‘tag__in’ => $array )it always outputs thus:
[tag__and] => Array ( [0] => 7,9 )
But the query wants only values separated by commas. Because of this it only recognizes the first tag.
So how do I make an array only output comma separated values without keys? (PS I tried implode() and got the same result).
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using an array in query_posts’ is closed to new replies.