WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Forgive me if this is too basic of a question...

I am using Twenty Eleven and am wanting to only allow my "news" category show on the front page, excluding all other categories.

How can I do this?

share|improve this question
As in, only show posts from the news category? – mor7ifer Jan 28 '12 at 0:05
Yes, only allowing that category. – Keith Groben Jan 28 '12 at 0:13
up vote 1 down vote accepted
$args = array(
    //post basics
    'post_status'    => 'publish',
    'post_type'      => 'post',
    'posts_per_page' => 10
    'orderby'        => 'date',
    'order'          => 'desc',
    //category query
    'tax_query'      => array(
            'taxonomy' => 'category',
            'field'    => 'slug',
            'terms'    => 'news' //make this the slug of the category you want to use
$posts = new WP_Query( $args );

$posts will now contain 10 posts from news. You can tweak this as you see fit, it's pretty simple to do, and WP_Query is INCREDIBLY powerful.

Docs: WP_Query

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.