I am setting up a site that pulls recent posts out of wordpress and shows them on the homepage. Everything was working great until I added some other functionality on the homepage. The other functionality pulls some content out of a database that’s not the wordpress database.
In doing so, it selects another DB using @mysql_select_db($db). It looks like the wordpress code I have on my homepage doesn’t set the DB back to the wordpress database. Is there a simple way (without having to put the database server, db, user, password all into my code again) to reselect the WP database?
Here’s what I’m currently using to pull the WP post onto the homepage:
$posts = get_posts(‘numberposts=1&order=DESC&orderby=post_date’);
foreach ($posts as $post) : start_wp();
<h2>” rel=”bookmark” title=”Permanent Link: <? the_title(); ?>”><? the_title(); ?></h2>
<? the_excerpt_rss(); ?> ” rel=”bookmark” title=”Permanent Link: <?
the_title(); ?>”>Keep Reading »
- The topic ‘resetting database connection back to WP db’ is closed to new replies.