Okay
  Public Ticket #1806373
blogroll
Closed

Comments

  • samer started the conversation

    Hi, is there anyway to pick a certain category to display on the home page rather than all the posts sorted by date? 

  •  93
    djwd replied

    Hi there,
    apologies for the delay.

    Not through the options, you would need to customize the homepage template. Making this modification would work. Customizations not usually covered but since my late reply I will try to help you out with this

    Open page-templates/homepage.php, on line 72 where you see this:

    $custom_query_args = array(
     'post_type' => 'post', 
     'posts_per_page'=> get_option( 'posts_per_page' ),
     'paged' => $paged,
     'post_status' => 'publish',
     );

    add the category_name parameter, like this:

    $custom_query_args = array(
     'post_type' => 'post', 
     'posts_per_page'=> get_option( 'posts_per_page' ),
     'paged' => $paged,
     'post_status' => 'publish',
     'category_name' => 'your-category-slug-here',
     );

    should help

    Another option, if you don't want to edit files, would be to set up a category page as a homepage through a redirect in your .htaccess or something like that, but I don't think that would be ideal.

    Hope it helps

    Regards
    djwd