Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have a blog page template , i need to make it display posts from specific category called news this is the template , i use thematic framework child theme

<?php
/**
* Template Name: Blog
*
* This template allows you to display the latest posts on any page of the site.
*
*/

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

?>

<div id="container">
<?php thematic_abovecontent(); ?>
<div id="content">
<?php
$wp_query = new WP_Query();
$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );
$more = 0;
?>

<?php

             // create the navigation above the content
             thematic_navigation_above();

             // calling the widget area 'index-top'
             get_sidebar('index-top');

             // action hook for placing content above the index loop
             thematic_above_indexloop();

             // action hook creating the index loop
             thematic_indexloop();

             // action hook for placing content below the index loop
             thematic_below_indexloop();

             // calling the widget area 'index-bottom'
             get_sidebar('index-bottom');

             // create the navigation below the content
             thematic_navigation_below();

             ?>
</div><!-- #content -->
<?php thematic_belowcontent(); ?>
</div><!-- #container -->

<?php

    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling the standard sidebar
    /*thematic_sidebar();*/

    // calling footer.php
    get_footer();

?>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Try changing :

$wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );

to

$wp_query->query( array( 'category_name' => 'news','posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );

You need to use slug, in this example "news" is the slug of the category.

share|improve this answer

Your Answer

 
discard

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.