Integrating Wordpress: Error establishing a database
Posted: Thu Jun 21, 2012 9:25 am
Hi Guys,
I am having trouble with displaying recent post preview from my wordpress to my opencart site.
I've included this code to my site, however i received an error message saying "Error establishing a database connection". Anyone? Thanks in advance
I am having trouble with displaying recent post preview from my wordpress to my opencart site.
I've included this code to my site, however i received an error message saying "Error establishing a database connection". Anyone? Thanks in advance
Code: Select all
<ul>
<?php require($_SERVER['DOCUMENT_ROOT'] . '/wp/wp-load.php'); query_posts('showposts=3'); if
(have_posts()) : while (have_posts()) : the_post(); ?>
<li>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<span>Posted on <?php the_time('l jS F, Y') ?></span><br />
<?php the_excerpt(); ?>
</li>
<?php endwhile; else: echo "no posts"; endif; ?>
<?php wp_reset_query(); ?>
</ul>