WordPress.org

Support

Support » How-To and Troubleshooting » Combining Blogs

Combining Blogs

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi

    Two approaches:
    1) assign posts to categories and display only one category on each of your existing pages.

    sample code added to page.php below

    2) switch to subdomains and use the wp-hive plugin to run all 6 installations from a single install of code and plugins.
    http://wp-hive.com/

    for #1:
    to display one category on a page:
    1) edit theme’s page.php template in a text editor – not a word processor
    /wp-content/themes/{themename}/page.php

    2) find the start of the WordPress loop
    ( looks something like this- sometimes on one line)

    <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>

    3) add this next code before those lines – add your additional categories, change the category ID codes to the ones on your installation. the text in is_page(‘xxx’) should be the page slug (URL) from your static WordPress page

    <?php
    $cat = '';
    if (is_page('events')) {
       $cat = '6';  // the WP category ID code for the events category
    } elseif (is_page('activities')) {
       $cat = '11';  // the WP category ID code for the activities category
    }
    
    if ($cat) {
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      query_posts("cat=$cat&amp;paged=$paged");
    } ?>
    
    [loop starts here]   === delete this line - next code is already in page.php
    
    <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>

    see http://codex.wordpress.org/Template_Tags/query_posts

    Thanks for the info. I also received some advice about restricting pages based on categories using one wordpress intalaation.
    what would be an advantage of using WordPress MU if I will be the only person adding content.
    Thanks
    gene

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Combining Blogs’ is closed to new replies.
Skip to toolbar