CubeCart and Wordpress Integration
Following my 100% CubeCart orientated posts, here's another late night hack.
It integrates a Wordpress blog into your store's homepage.
You need a working Wordpress installation to start with, I installed mine in the standard /wordpress/ folder, none of your customers will see it anyway.
You will also need SimplePie which is a very fast and simple RSS Parser for PHP. Just download and place in any directory.
First off, edit includes/content/index.inc.php and put this about line 55
require('LOCATION TO SIMPLE PIE/simplepie.inc');$feed = new SimplePie('LOCATION TO WORDPRESS FEED');
$feed->handle_content_type();$i = 1;
$posts = Array();
foreach ($feed->get_items() as $item) {
$posts[$i]['LINK'] = $item->get_permalink();
$posts[$i]['TITLE'] = $item->get_title();
$posts[$i]['CONTENT'] = $item->get_content();
$posts[$i]['DATE'] = $item->get_date('j F Y | g:i a');
// assign array data
$index->assign('DATA', $posts[$i]);
$index->assign('ROW_NR', $i);
// parse a row
$index->parse('index.table.row');
$i++;
}
$index->parse('index.table');
Make sure you replace "LOCATION TO SIMPLE PIE" with the correct page.
Make sure you replace "LOCATION TO WORDPRESS FEED" with your wordpress feed. Don't know what this is? Goto your Wordpress blog and hit the RSS icon in the location bar to go to the feed location.
Next, edit yourskin/styleTemplates/content/index.tpl. I replaced the following
{HOME_TITLE}
{HOME_CONTENT}
with
{DATA.TITLE}
{DATA.CONTENT}
{DATA.DATE}
This will replace the "Home Page" text with your blog entries.
Simple, huh?
If any one needs any help, customisation etc, contact me.
Related posts:
- WP-O-Matic Bug Fixes Round Up
I've run into quite a few issues in the latest 1.0RC3-7 release of WP-O-Matic. Here's... - Crawl Rate Tracker and Wordpress 2.5 Manual Fix
A quick update on people that need the Crawl Rate Tracker to work with Wordpress... - How to move Wordpress directory or server – properly
I ran into an annoying, but easily avoided problem the other day. When moving a... - Using Wordpress header and footers externally
I needed to integrate a Wordpress header (header.php) and footer (footer.php) into an external application.... - Redirecting WordPress index.php to root
If you check the Page Rank of http://bloke.org against http://bloke.org/index.php, which are both, to a...
July 25th, 2008 - 07:37
i have been trying to your wordpress integration but i get this error:
Parse error: syntax error, unexpected ‘&’ in /home/ourspot/public_html/includes/content/index.inc.php on line 60
s
July 25th, 2008 - 08:11
ok so i sorted that bit out by replacing > with > but unfortunatley now i get this in the space where the blog should be
[XTemplate]
* parse: blockname [index.welcome_note] does not exist
* parse: blockname [index.table] does not exist
* parse: blockname [index] does not exist
November 28th, 2008 - 05:29
Hi
I want to integrate wordprss blog with my wholesale store? Would you be able to help me on this matter? how much you will charge for this integration and customazation?
Thank you
abdu
http://www.simsimgate.com
May 8th, 2010 - 19:53
i cant get this to link to my homepage please help!!!