I am trying to make a function and exclude in the post query that way im able to define the id's in my function but it is only excluding 1 post instead of the 4 it is returning.
any suggestions on how I can go about successfully executing this?
function in the functions.php file
function slider_exclude(){
$exclude_query = query_posts(array('showposts' => 4, 'cat' => 'news',));
foreach($exclude_query as $post_ids){
return $post_ids->ID.',';
}
}
my loop
$args = array(
'post__not_in' => array(slider_exclude()),
'post_type' => 'post',
'posts_per_page' => 15,
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
);
query_posts($args);