0

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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