Second Blog

How To Make A Second Blog With WordPress (3.5.1)

Second BlogHey guys, a few years back I wrote a tutorial for creating a secondary blog in WordPress, I wrote it when WordPress was version 3.03, and pretty soon after that, the updates destroyed my work.

Well now, I have finally fixed the code and it’s all back up and running.

So I decided to re-write the tutorial for the latest version (3.5.1). This tutorial will walk you through all the necessary steps in order for you to create your very-own second blog in WordPress.

Making the Categories


So first off you want to make a category that you will be using in the second blog, this will define what is in the new section.

  • Under the ‘Posts’ tab in the sidebar go to the Categories page.
  • Make a new category (more than one if you want to have multiple categories associated with the new blog), you may call it whatever you want but make sure you remember it’s unique ID to use later on, if you don’t know its number, click on it in the categories page and it should be in the url.

Making the PHP File


What you want to do now is make a new PHP file.

  • Go into your Editor page (located under the apperance tab in the admin sidebar) and select the ‘Main Index Template (index.php)’.
  • Copy all the text and code to your clip-board.
  • Create a new blank text document using either Notepad or Wordpad or any other text editor and paste all of the code into the blank text documment.
  • Add the following code above all of the code and text into the text document:
/*Template Name: Blog*/ 


  • Replace the ‘Blog’ part in that code to whatever name you want, just make sure you can recognise it later on.
  • Save the file as blog.php (replace ‘blog’ with the name of your choice).
  • Upload the PHP file to your theme folder (e.g

Creating the Query


Now you want to define the content that your second blog displays (i.e the categories we made before).

  • Go to the Editor page again (under the apperance tab) and open the new page that you made (i.e blog.php).
  • Now a few lines down the code you should see what WordPress calls ‘the loop’ (if you don’t see the loop, refer to Complications towards the bottom of this tutorial) which looks something like this:
<?php if ( have_posts() ) : 
while( have_posts() ):the_post(); ?>


  • Replace that code with the following code:
query_posts( 'cat=#' );

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


  • Replace the # symbol with the category ID number that you made earlier.
  • Click the ‘Update File’ button.

Note: If you have two or more categories that you want to associate with your new blog, simply seperate each category ID with a comma (,) (e.g: cat=12,5,9)

Stop Posts From Displaying in the Main Section


So now that the posts can display in the new section, you’re going to want them to NOT display in the main section.

  • Open up the Main Template File (index.php) in the Editor page again.
  • Now this one is slightly different, instead of replacing the loop, we are going to add the following code right above it:
if ( is_home() ) {
	query_posts( 'cat=-#' );


Note: Remember to put a minus (‘-‘) symbol infront of the unique ID’s this time, so instead of inserting it, it’s going to remove it.

  • Just like last time, replace the ‘#’ with the ID tag of your category (if you have more seperate them with commas just like before).
  • Click the ‘Update File’ button.

Creating the Page


Now you want to create the page that is going to hold the PHP file.

  • Go to the Add New page under the ‘Pages’ tab.
  • Give the page a name (e.g ‘Blog’).
  • In the sidebar on the right in the ‘Attributes’ section you should see a setting called ‘Template’.
  • Click the Dropdown menu and select your PHP file name (i.e ‘Blog’).
  • Then click ‘Publish’

Adding Posts to the New Section


What you’ll want to do now is add posts to this new section that you’ve created. It’s very simple.

  • Write a new post.
  • Have the categories for the new post set on the categories that you created and added to the files (if you use any of the ones that you didn’t add the the list, it will display on the main page and not in the new section).
  • Click ‘Publish’




This section is for those of you who don’t have the loop in their index file, this is most likely because the theme you chose is drawing the loop from another file in the themes folder, most likely called ‘content.php’.

If this is the case, you will need to copy the content from content.php into a text editor, such as notepad, and save it as something like blogcontent.php and upload it to your theme folder like you did for blog.php.

Now you will need to open your blog.php file in the editor and locate the code that looks something like this:

get_template_part('content'); ?>


That code is what’s drawing in your loop for both your index.php and blog.php files.

You now need to replace ‘content’ with ‘blogcontent’ (keep the apostrophes there).

Now you should be able to go back to the Creating The Query section, but where it says to add codes to certain sections, just add them to the content.php and blogcontent.php sections instead (index = content, blog = blogcontent).

That should be it, but as I’ve said, this part is very complicated, if you need additional help, feel free to ask in the comments, or if you have a bigger issue, contact me through the contact page and I may be able to edit your themes files if you send the relevant copies.



And there you have it!, you have now got a second blog in one single wordpress install, pretty neat huh?

Note: This can be repeated as many times as you like, you could have 5 different blogs in one wordpress install if you really wanted!

I hope you found this tutorial helpful, and I’m sorry it took so long for me to fix it. If you have any questions, feel free to ask in the comments.

20 thoughts on “How To Make A Second Blog With WordPress (3.5.1)

  1. Pingback: Create a Second Blog in Wordpress [How-To] (Revised) | Zero Atoms

  2. Matt Adams

    Hi Sean, I really need your help with this.

    I was following along for a bit until I got lost at “CREATING THE QUERY”.

    I don’t have any of that, nor do I have what you put under “COMPLICATIONS”.

    I am using the Optimize Press theme (it’s a plugin) so this is probably why.

    I tried pushing through it but I haven’t got it and it doesn’t work, so I really need your help with this.

    And I’m sure you’re busy, but I am under a deadline, so I really hope you can help me soon. I can send you whatever you need.

    Thanks for putting this together.

    All my best,


  3. Tom Williamson


    Great tutorial. I am having difficulties though, and its based on the theme I am using.
    I am using Journal Crunch

    The difficultly is while I follow and create a replication of index.php, there is a separate homepage.php.

    I believe I will have to replicate the home.php in some form in order to achieve similar, however, php isn’t my strong point.

    Could you help me out?


    1. Sean Post author

      Hey mate, sorry for the extremely late reply, your comment got lost among a tonne of spam comments.

      If you still need help, I’d be happy to, just send me an email over at “”

  4. thatstevemills

    Hi Sean,
    I need a little help. I followed your instructions and the issue I am having is that my Portfolio posts are showing up in the blog list as well as the Portfolio list. What have I missed.

    1. Sean Post author

      Hi Steve, sorry for the late reply, just found it among all the spam, if you still need help, toss me an email at “” include all relevant .html files

  5. Ivan Rusev

    Hi Sean, I have a question.
    Is your tutorial working with WordPress 3.6.1 ?
    First of all I am absolute beginner.
    I followed your steps but the post under given category appears both in the main section and in the new section.
    I am using Responsive-child theme.
    I put the new blog.php file into: wp-content/themes/responsive-child.
    Then I made a copy of index.php from: wp-content/themes/responsive
    and inserted it into: wp-content/themes/responsive-child
    then I added the code to stop posts from displaying in the main section.
    Where is my error?

    Thanks in advance.


    1. Sean Post author

      Hey Ivan, sorry for the super late reply, your comment got lost among spam, if you’d like help still, chuck me an email at “” and I’ll give it a crack, include all relevant .html files

    1. Sean Post author

      Sure Tim, sorry for the late reply, spam comments filled my comments section up, send me an email at “” and I’ll see what I can do, include all relevent .html files from your theme.

    1. Sean Post author

      Yep, sure thing, just send me an email using either my contact form or my email I’ve specified above to a few people, I’ll take a look.

  6. De Reisjournalist

    Hi Sean, this has been very helpful, thanks so much! I do have one issue: this somehow breaks the pagination. On the page created with the new template, when I get to the bottom of the page and click ‘Previous posts’, I do get a page 2 (also with a url ending in ‘page/2/’), but with the exact same ten posts as on the first page. So I can never get to the eleventh post. Any idea how I can fix this? Your help would be much appreciated!

    1. Sean Post author

      Hi mate, yep I’ve just responded to your email, hopefully what I changed in your .php files solves your issue.

  7. JonnyB

    Hi Sean – thanks for taking the time; found this via Google and it was invaluable for me as someone who’s never learnt php.

    It didn’t quite work on my theme (Nirvana), but looking at your methods I was able to work out enough about the code to work a similar alternative.

    In case it’s useful for other passing visitors using this or similar themes, the loop is contained within a template-blog.php file.

    Near the start, the posts to be displayed in the loop are defined by the line of code:

    $the_query = new WP_Query( ‘post_status=publish&orderby=date&order=desc&posts_per_page=’.get_option(‘posts_per_page’).’&paged=’ . $paged);?>

    Adding the category to be excluded in to this function does the trick:

    $the_query = new WP_Query( ‘cat=-#&post_status=publish&orderby=date&order=desc&posts_per_page=’.get_option(‘posts_per_page’).’&paged=’ . $paged);?>

    (Replace ‘#’ with the category code, as per your instructions above).

    I’ll then be running the second blog by simply using a ‘category’ page for posts that I want to keep separate.

    Cheers, and appreciate the step-by-step guide.



Leave a Reply

Your email address will not be published. Required fields are marked *