scriptygoddess

13 Apr, 2002

How to have two blogs on one page

Posted by: Jennifer In: How to's

There's probably more than one way to do this, but here's how *I* do it

BLOG A is my main blog. I have another blog called "announcements". This blog is as plain vanilla as can be. (there's not even any <html> </html> tags or <body> tags… it's just the text by itself.

Then on my main blog page, I do a php include to pull in that announcement text where I want it to show up. Assuming you have your page named with a .php extension (or your server is configured to process html files like they're php files (as it is explained here) you do a php include simply like this:
<? php
include("http://www.YOUR_SITE.COM/YOUR_SECONDARY_BLOG_FOLDER/");
?>

and that's it. Easy shmeasy.

5 Responses to "How to have two blogs on one page"

1 | Pet Rock Star

May 20th, 2002 at 7:30 pm

Avatar

I used this as a starting point for something I was working on, and just wanted to add another level to it.

What I wanted to do was manage multiple blogs on one page, but have each of those blogs have the ability to stand alone (which the post above doesn't really allow). The solution (with a little help from the great Phil Ringnalda): create an additional index template with the output file "last3.txt" for each of your additional blogs that looks like this:

<MTEntries lastn="3">
<b><$MTEntryDate format="%B %d, %Y"$></b><br>
<$MTEntryExcerpt$>
</MTEntries>

Then, you use your excerpt field for a handy-dandy description of the post, and use this:

<? include('http://www.yoursite.com/blog/path/last3.txt'); ?>

to pull them onto the main page, leaving the other blogs completely intact and beautimous.

2 | Jennifer

May 20th, 2002 at 7:47 pm

Avatar

Great tip! Thanks! :)

3 | Beatriz

June 5th, 2002 at 10:36 am

Avatar

Jennifer, I'm pretty new with PHP and I have a question (might be a little stupid, LOL): Where does this PHP include go? At the beginning of the code, before the starting tags, or inside the code where you want your other blog to be displayed?

I know how to make simple includes, but I always use two tags. The one that goes before my html starting tag and the other that goes where I want to make the include. Is this the same?

4 | Christine

June 5th, 2002 at 11:05 am

Avatar

Not Jennifer, but I figured I would answer it for her. The PHP include goes inside the code where you want the other blog to be displayed. Or any file for that matter – the sidebar on my blog is made up of about 5 include files. Hope that helps!

5 | Beatriz

June 11th, 2002 at 2:48 pm

Avatar

Thank you, Kristine! I was asking because I use some includes and I put something at the beginning of the code to make them work, but this one here seems simple! :-)

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements