View Single Post
  #6  
Old 09-28-2009, 03:52 AM
 
autobulbs autobulbs is offline
 

Advanced Member
  
Join Date: Feb 2007
Location: Southampton, UK
Posts: 68
 

Default Re: Display latest Wordpress Posts

I did solve this, and here is how:

PHP Code:
<?php

#Connect to the wordpress database
db_connect('wp db host''wp db user''wp db pass');
db_select_db('wp db name');

#Select the posts
$blog_headlines func_query("SELECT post_title,guid,post_name,ID,DATE_FORMAT(post_date,'%d/%m/%Y') as post_date, post_date as orderbythis FROM wp_posts WHERE post_status = 'publish' GROUP BY post_title ORDER BY orderbythis DESC LIMIT 3;");

#Stuff them into a smarty array
array("blog_headlines" => array());
$smarty->assign("blog_headlines"$blog_headlines);

#Connect to the X-Cart database - these variables are in config.php
db_connect($sql_host$sql_user$sql_password);
db_select_db($sql_db);

?>
__________________
Autobulbs Direct Ltd
X-Cart Version: 4.2.2
eWay Designs - Custom X-Cart Templates / CMS Websites / Bespoke web applications
Reply With Quote