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've searched for this but can't find a clear answer.

I'd like to have my main blog page display posts with certain categories and then have another blog page that shows different categories.

How would I do this?

Thank yoU! Matt

share|improve this question

1 Answer 1

One way would be to create a template page, and in that page, you'd have the logic to display the categories you want to show. Your template page would look something like this:

/*
Template Name: Secondary Blog Page
*/

get_header();

/*Code for your custom category display*/
$customcats = new WP_Query(array(
    'cat' => 12,13,15  //Category ID's
));
if($customcats->have_posts()):

while($customcats->have_posts()): $customcats->the_post();
    //code to display the posts however you want
endwhile;

endif;
wp_reset_postdata();

get_sidebar();
get_footer();

Then you'd create a new page, and choose this template to render it.

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.