• Hi,

    I’m trying to add a second blog to my wordpress site. I copied the index.php page and made changes by replacing this code:

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

    with this code:

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query(‘posts_per_page=5′.’&paged=’.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>

    I also replaced

    <?php endif; ?>

    with

    <?php $wp_query = null; $wp_query = $temp;?>.

    Then I saved as blog.php and uploaded it to my theme directory as a template. Then I applied that new template to my blog page. When I loaded the blog page afterwards, however, it had the same posts as my front page. So basically, the second blog I created is identical to the front page. How do I separate the blogs and have totally different posts on the two pages? Any help would be appreciated. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding second blog to wordpress site’ is closed to new replies.