Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #61205
    svr
    Member

    http://www.de100morgen.nl/

    Hello,
    On this site, the homepage uses a blog template. I would like to add another page with a blog template. I would like my home page to show only posts with certain categories and on the other blog page posts with other categories. Is this possible?
    Thanks.
    Sabine

    #61369
    Sakin
    Keymaster

    @svr: There is no option to make two pages blog. So, either you need to make your homepage to show latest posts or you can assign any other page as blog from “Appearance => Customize => Static Front Page”. Then you can select particular categories from “Appearance => Theme Options => Homepage/Frontpage Category Settings”

    But if you want another pages to show blog as well. Then you need to build child theme and then create page template to show blog with particular categories. For that, you can create php file like template-selected-category.php and then copy code from page-blog.php then change then change template name and add category_name. See the example code as below, where I change template name to Selected Categories Template and added category staff and news.

    Template Name: Selected Categories Template
    $blog_query = new WP_Query( array( 'category_name' => 'staff,news', 'post_type' => 'post', 'paged' => $paged ) );

    Note: You can read more about child theme at http://catchthemes.com/blog/create-child-theme-wordpress/ and WP_Query at https://codex.wordpress.org/Class_Reference/WP_Query

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Pages with blog template’ is closed to new replies.