Forums

[resolved] Importing Posts For Specific Pages (3 posts)

  1. w3dgie
    Member
    Posted 4 weeks ago #

    Hey,

    Basically what I'm looking for is to be able to have certain posts displayed on certain pages from certain categories.

    for example:
    Tutorials

    I have a page called /tutorials/

    I also have a post category called Tutorials and I would like all posts in the Parent & Child categories for Tutorials to be posted in the /tutorials/ page.

    Once that is complete, I have another small question. Is it possible to exclude that category from showing up in the blog section of my site?

    Here is what I have inside my page.php

    <?php
    
    $tutorials = "/tutorials/";
    $currentpage = $_SERVER['REQUEST_URI'];
    
    if($tutorials==$currentpage) {
    query_posts('cat=22');
    }
    
    else {
    the_content('<p class="serif">Read the rest of this page &raquo;</p>');
    }
    
    ?>

    Please help, thanks in advance.

  2. MichaelH
    moderator
    Posted 4 weeks ago #

    WordPress native archiving process will do this for you if you just create categories. You don't need Pages. But if that's the way you want to go read the Page of Posts example in the Pages article.

    If you want to put those categories as navigation items in your nav bar for examle, see this:
    How to easily display links to both Pages and Categories in the blog navigation header?

  3. zeally
    Member
    Posted 4 weeks ago #

Reply

You must log in to post.

About this Topic