Forums

Run 2 Blogs on 1 Theme? (4 posts)

  1. skippertech
    Member
    Posted 1 year ago #

    I have a Tech Website and on the homepage the blog is tech, I would love to have another page where it could be my personal blog, but I could get all the home page jazz on it (like the thumbnails, etc.) but when I write a post I could choose which blog it goes too...

    Thanks

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Just make a page template called myblog.php or something
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    make it a copy of index.php, but add the required header on top

    Make a new page through the WP page editor, assign it the new template you just made

    Now, create a new category called blog, and find out its ID

    Now whenever you make a blog post, categorize it as blog.

    Use query post on index.php and on myblog.php to include/exclude the blog category
    http://codex.wordpress.org/Function_Reference/query_posts

    So, on index.php put this above the if ( have_posts() ) : loop beginning
    query_posts('cat=-4');

    And on myblog.php
    query_posts('cat=4');

    This is assuming the blog category is 4, the above sample code would exclude blog posts from your main index (tech) page, and show them only on the new myblog template

    That's one way to do it anyway!! Just the first thing that came to mind early in the morning

  3. signalsinthesky
    Member
    Posted 1 year ago #

    Hi, totally new wordpresser here; not a coder or anything. If anyone can point out what I'm doing wrong that would be great. I'm slightly lost with this. Here's what I did and how I did it:

    I created the page template using dreamweaver. I named it academia.php. I assume I upload this file to my root directory or do I upload it into my theme directory? I put it in both for now, (just to clarify i put it in the themes directory but not in my theme 'white as milk' folder).

    I then made a new page called Academia. I didn't assign the new template because I'm not sure how? on the right there is a drop down menu but the template I created Academia is not showing. I left it set to 'Default Template'.

    The next step I created the category. I called it Academia.

    Now the query bit; I followed the link but which bit of code do I need?
    or do I just put query_posts('cat=3'); in both files? anywhere?

    My page ID is 3 not 4.

    Thanks in advance.

  4. signalsinthesky
    Member
    Posted 1 year ago #

    I did it. Not this way but through adding a network. (really easy too).

    For future reference to anyone who stumbles on this post: http://codex.wordpress.org/Create_A_Network

    It seemed to be really well hidden when googling/searching the forums. I guess it depends how you search and using the right terms e.g. network, instead of 2 blogs.

    Silly me.

Topic Closed

This topic has been closed to new replies.

About this Topic