Post by tag / Exclude tag / New function
-
Hi. I try to modify the function alchymyth was kind enough to help me (a lot) with but I don’t seem to make it work.
Here it is:
<?php global $do_not_duplicate; ?> <?php $my_query = new WP_Query(array('posts_per_page' => 10, 'post__not_in' => get_option( 'sticky_posts' )) ); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->ID; ?>It is not the entire function (not needed), my problem being I try to find a way to only show posts from a specific tag. Then I want another query (using the same code) to exclude posts from this specific tag (to avoid duplicates).
I know how to do that using the old code (<?php query_posts(‘posts_per_page=10&tag=books’); ?>) but not this new one with arrays…
Thanks for your help! 🙂
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Post by tag / Exclude tag / New function’ is closed to new replies.