Problems with wp_query
-
Hello,
All my posts have tags. Now I want to select all posts that have certain tags and display 4 of them.
In string I have my tags “tag1+tag2+tag”. This part works, but it always shows all posts with the specified tags and not only 4. Ideally I would want to show 4 random posts that have the specified tags.$featuredPosts = new WP_Query(‘post_count=2’);
$featuredPosts->query(“tag=$string”);
while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
.
.
.Can anyone please help me?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Problems with wp_query’ is closed to new replies.