shama
shama

Reputation: 11

How to display non featured wordpress posts

I have upload a plugin as 'featured posts' to add featured posts, also adding regular posts, both type of posts having default category(say, buy know). I want to display only regular posts(i.e non featured), but I unable to display only the regular posts, its displaying total posts(i.e regular plus featured). Please any one help me to display only the regular posts. Thanks Shama

Upvotes: 0

Views: 73

Answers (1)

DE HAMS
DE HAMS

Reputation: 1

$feature_ids=array();   

$query=query_posts('featured'=>'yes');

while(have_posts()):the_post();

$feature_ids[]=get_the_ID();

endwhile;wp_reset_query();


// now your feature posts id store in $feature_ids as array then
// in actual query

$query=new WP_Query('post__not_in'=>$feature_ids);

 // it will exclude the posts that are feature

if(have_posts()):while(have_posts()):the_post();
// yours data

endwhile;endif;wp_reset_query();

Upvotes: -1

Related Questions