• Resolved justbishop

    (@justbishop)


    Anyone know why this isn’t working? No errors or anything, but the posts tagged “blog” and “gallery” are still showing:

    <?php 
    
                    $term = get_term_by('slug','blog', 'post_tag');
    				$term2 = get_term_by('slug','gallery', 'post_tag');
    				$args=array(
      					'tag__not_in' => array($term->term_id, $term2->term_id),
      					'post_type' => 'post',
      					'post_status' => 'publish',
      					'caller_get_posts'=> 1
    				);
    
                    query_posts(array('tag__not_in' => array($args)));
    
                    if (have_posts()) : ?>
Viewing 1 replies (of 1 total)
  • Thread Starter justbishop

    (@justbishop)

    Got it, thanks Kawaouso in #wordpress IRC!

    <?php 
    
                    $term = get_term_by('slug','blog', 'post_tag');
    				$term2 = get_term_by('slug','gallery', 'post_tag');
    				$args=array(
      					'tag__not_in' => array($term->term_id, $term2->term_id),
      					'post_type' => 'post',
      					'post_status' => 'publish',
      					'caller_get_posts'=> 1,
      					'paged' => $paged
    				);
    
                    query_posts($args);
    
                    if (have_posts()) : ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Excluding Posts With Tag Using query_posts’ is closed to new replies.