• Is there a way to ad multiple posts to different pages? The idea is to have different sections (pages?) in the weblog with different posts showing up in each section (or page), as opposed to ALL posts showing up in the main page. Is this possible?

    Many thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is certainly possible. What you need is a separate page template in the theme that you’re using. You can create your own, or find an existing theme that has instructions on how to set one up (I’m doing this same type of thing, and I opted to create my own theme).

    You could use categories in your posts to make sure that only certain posts show up on a particular page. Then, in your code for the page you’re using, you would have a query that pulls posts by that particular category.

    Here’s an example when the category of a post is “home” (for posts that you want to show up on a home page):

    <?php
    $home_query = new WP_Query('category_name=home');
    
    if ($home_query -> have_posts()) : while ($home_query -> have_posts()) : $home_query -> the_post(); ?>
    
    <!--Your code to display and style each post goes here -->
    
    <?php endwhile; ?>
    <?php endif; ?>
    Thread Starter cfibanez

    (@cfibanez)

    Thank you. But this means that I would still need to have all posts featured in the main page, right? I’d ike the front page to be dedicated, say for news only. Thanks for help.

    You could do the same type of thing on the main page. The key (in my example) is the category name. Assign your special category to the posts you want to display, and then use the custom WP_Query, specifying which category name you used.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multi post pages: can it be done?’ is closed to new replies.