How can I insert a blog (not created yet) into an 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.
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. It’s 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 it’s 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:
Then, getting a list of recent posts is as easy as:
Just look out for using deprecated functions, I’ve got a few still left to clean out from when I integrated WP 2 years ago.
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
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.
Often it’s probably easier to just use a WordPress blog and re-create the rest of your static website with that.
You can also do it by installing wordpress on your server, cutting down a wordpress theme to its bare bones, adding your own styles, header, navbar, etc. on top of the wordpress theme, and then linking to it as a page in your site. This looks cleaner than using an iframe, and is way easier to do than using loop. Check out the following link for instructions on how to do this (conveniently written on a blog set-up in this manner):
http://www.nubaria.com/en/blog/?p=14
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.
I used SnewsCMS for that, it is trivial to integrate news section in static php pages.
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.
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.
You can also do it by installing wordpress on your server, cutting down a wordpress theme to its bare bones, adding your own styles, header, navbar, etc