Separate blog on one WordPress

If the thing is that: though it’s a complete blog of an Institute, it’d be a simple one category blog with many posts under that category, then my solution is very simple:

Idea: Create a category for each of the institute like: “Institute 1”, “Institute 2”, “Institute 3” etc. Then instruct your Institutes to blog their posts under their respective category. So then your posts are sorted by the Institute # categories.

Implementation: Now create a Page Template for each Institute. Create a new PHP file with:

<?php
/*
Template Name: Institute 1
*/

$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$sticky = get_option( 'sticky_posts' );
$args = array(
                'category_name' => 'institute-1', //use category slug, not name
                'order' => 'DESC', // Sort as LIFO
                'orderby' => 'date', // To find out the latest post
                'paged' => $paged //for pagination
);

$query_blog = new WP_Query( $args );
?>
<?php if( $query_blog -> have_posts() ) : ?>
    <?php while( $query_blog -> have_posts() ) : ?>
    <?php $query_blog -> the_post(); ?>
        <article id="post">
            <h2 class="post-title"><?php the_title(); ?></h2>
            <div class="post-desc"><?php the_content(); ?></div>
        </article>
    <?php endwhile; ?>
<?php endif; ?>

Save the page naming Template-Institute-1.php. Add a New page from wp-admin, and choose the Template from the sidebar named: “Institute 1”. Save the page and make a menu link for the page.

Now the page will be simply a blog page for the “Institute 1” category. It’ll display all the posts from the category “Institute 1”.

Just repeat the process for each of the blogs/institutes and make some more static pages as blogs. But remember to change the two things in each time:

  • The template name at the very beginning: Template Name: Institute #, and
  • The 'category_name' => 'institute-#', inside the $args array