treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Wordpress question

  • Is it possible to have several blogs running within Wordpress at the same time each with it's own subject matter?
  • Do you mean under the same admin panel? Not sure I understand the question.
  • Hey virtual.

    Yes it is possible! You can do it a couple of ways:

    You can have various blogs under one WordPress install which each use different categories. So for example, you have 3 blogs, each uses it's own template containing a loop which shows only posts from its corresponding category. So a blog about dogs only shows posts in the category 'dogs', the blog about bears only shows posts with category 'bears', and so on. When you write the posts you simply check the category you want the post to be in and it's then only shown on that blog's page.

    Another way is to use separate installs: http://codex.wordpress.org/Installing_Multiple_Blogs

    Hope that helps!

    John
  • Thank you Johnnyb, that helps a lot. So if I understand correctly the specific category would have to be set up within the each loop? Would this also allow separate archives for each category?
  • Hey, yeah you would just set it up to use query_posts to display only the category you want:

    <?php query_posts($query_string . 'cat=1&posts_per_page=10');
    if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div id="post" <?php post_class(); ?>>
    <h2><?php the_title(); ?></h2>
    <?php the_excerpt('Read More'); ?>
    </div><!-- #post -->
    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>


    If you want full capabilities with each blog though, archiving and search etc, then it's probably best to set them up as separate blogs using that link I posted. It can be done using the first method but it takes a lot of custom coding.
  • Thank you so much for that, I appreciate the help. I may be back for more help as I'm fairly new to coding Wordpress.