Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter luke.faragher

    (@lukefaragher)

    Solved it for anyone else who might find this useful…

    //This is the query that gets the blocked Post IDs
    
    		$things = array();
    		$results = $wpdb->get_results( "SELECT sid FROM wp_entries WHERE uid = '$current_user->ID'");
    		foreach( $results as $result )
    		$things[] = $result->sid;
    
    //This is the query that blocks the posts
    
       $args = array('cat' => 8, 'showposts' => 3, 'post__not_in' => $things );
       $category_posts = new WP_Query($args);
    
       if($category_posts->have_posts()) :
          while($category_posts->have_posts()) :
             $category_posts->the_post();
Viewing 1 replies (of 1 total)