• Greetings! I’m creating a website using WP as my CMS.
    I need to have a “blog” Section.
    But then I need another section where I can post news posts. How can I accomplish this? I know you can post posts to pages but that would make the same posts for both pages, “news” and my “blog” section… So its almost as I have to have two different blogs. If I use categories, in my “blog” page you would see all the posts not just the blog posts… But I’m sure I can somehow do this in WP because I’ve seen many WP sites that accomplish this…

    Thanks in advance!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yep. What you would do is set up a couple of different page templates. You’d open page.php and save it as something else, like “page_blog.php” and then paste this into the very very top before anything else

    <?php
    /*
    Template Name: Blog
    */
    ?>

    Then replace your normal loop with something like this:

    <?php query_posts('category_name=blog&showposts=10'); ?><?php while (have_posts()) : the_post(); ?>
    
    Title, permalink, and content code here
    
    <?php endwhile; ?>

    So basically for that page we’re telling it to only query posts that are filed under the category “blog”. You can replace that with whatever the slug name is of your chosen category. Then when you write posts you file them under the category of the page you want them to show up on.

    When you create your pages in the admin, after you upload your new page templates, you’ll be able to select a template for each page from a drop down menu on the right hand side under the “publish” button.

    Thread Starter everfound

    (@everfound)

    Hey, thanks for the help! However its not working ??
    all that shows up on the page is “Title, permalink, and content code here”

    Here is my code… I’m no coder so it might be an obvious mistake…

    <?php
    /*
    Template Name: Blog_t
    */
    ?>
    
    <?php get_header(); ?>
    
    <!-- content ................................. -->
    <div id="content">
    
    <?php query_posts('category_name=blog&showposts=10'); ?><?php while (have_posts()) : the_post(); ?>
    
    Title, permalink, and content code here
    
    <?php endwhile; ?>
    
    <?php comments_template(); ?>
    </div> <!-- /content -->
    <?php get_sidebar();?>
    <?php get_footer(); ?>

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Would this require multiple blogs?’ is closed to new replies.