views:

753

answers:

8

How can I insert a blog (not created yet) into and already existing 'static' webpage? The webpage is written mostly in php. I'm considering using something like wordpress.org (host install version) and using it to update the website's news page.

From what I've read, its sounds like I would need to do a lot of theme tweaking to get wordpress to display correctly with our website's template. This sounds a bit daunting to me. Any thoughts on the matter are appreciated!

Thanks!

A: 

A simple solution is to simply add an iframe and place the blog site in it. It takes almost no code and the blog entries will show up.

As for a code option, I would look at an RSS Reader, like this one: http://www.scriptol.com/rss/rss-reader.php

A bit of code, but you read the blog entries via RSS and display what you desire.

Gregory A Beamer
+1  A: 

Greg is right, an iframe is an easy way to do this. However, I've run into situations where the iframe will throw off session variables in IE, not sure if this impacts WordPress or not.

If you're going to create a page to house a WordPress install in an iframe, why not just have the link you would use to show the page with the iframe just link to a separate sub-domain where the WordPress install will reside?

My guess is you're not wanting to do a lot with theme development if you're wanting to throw WordPress into an iframe. If this is the case you have a few choices: (a) google for a blank wordpress theme, (b) develop a theme that looks like you're current site so that when a user clicks on a link, they won't know they're on a different platform, (c) don't hide anything and make the WordPress install show up with a different theme. Consider American Express in their OPEN Forum site (http://www.openforum.com/), with their blog at http://blogs.openforum.com/ - same header, slightly different body and layout.

Issues w/ going the iframe route is that a WordPress site will grow in height, where you'll have to set the height of an iframe. You can control this by setting the height to something very large, but then your page will be very large, or you can control the amount of posts that show up in the WordPress admin.

My suggestions, scrap the iframe, install your WordPress on a sub-domain and then link to that sub domain instead of linking to your iframe page

Tim Schoffelman
+3  A: 

I did the exact same thing on my site. I had about 20 static pages, wanted to add a blog and wanted to add content from the WP pages to the static pages. It was not hard to find a theme that (almost) matched my static pages. Everything outside of /tech/ is a static page.

You can also get a very minimalistic theme and then make it match your design. Its one big heaping cut and paste of CSS, re-labling elements to match what WP wants then a little tweaking. I've done it in under 8 hours on other sites.

Read up on using the Wordpress loop. This is so much easier than you think its going to be, especially if your stuff is already done in PHP.

Edit:

Here's a snippet of the code that I use in my static pages, which allows me to then use all of the other WP functions in the existing code:

<?php
if (empty($wp))
   require_once("tech/wp-config.php");
wp();
?>

Then, getting a list of recent posts is as easy as:

<?php get_archives('postbypost', 8); ?>

Just look out for using depreciated functions, I've got a few still left to clean out from when I integrated WP 2 years ago.

Tim Post
A: 

I used SnewsCMS for that, it is trivial to integrate news section in static php pages.

esmajic
A: 

Use Blogger service, you can set it up to publish the blog via FTP to your site. But still you have to customize the template. It should be easy though, they have an interface for it.

michal kralik
+1  A: 

I'm trying this now with a site I'm tinkering with (not public yet). Instead of publishing the blog directly on my site, I'm linking to a blog hosted by Google Blogger.

Google also offers the "AJAX Search API" which I'm using to embed into a static web page. I generated a dynamic marquee of links to my blog. Because the links are generated by AJAX Search, it always shows the most recent entries. It's a nice way to keep your site static, but also incorporate dynamic content that is hosted elsewhere.

Of course it would help to design your blog to match the branding of your main site. Extra points if you can use iframes or common navbars to make it all seamless.

Bill Karwin
A: 

When I had to tack a blog onto an existing site, I used textpattern. I found it very easy to customize because it's so lightweight and simple. It's much nicer to hack on than Wordpress, in my opinion, though the markup style is less user-friendly, and it lacks whizz-bang plugins, themes, etc.

I just installed it in its own directory so the inter-article links worked, and embedded the necessary textpattern guts into my own page layout.

grossvogel
+1  A: 

Often it's probably easier to just use a WordPress blog and re-create the rest of your static website with that.

adondai