Themes & functions outside wordpress & mysql_connect
-
I am writing a custom database page outside wordpress, but would like to import my wordpress theme and also pull in a post for this page.
First, I include this to pull in the wordpress theme and other functions:
require($_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-blog-header.php’);now, if I include a call a wordpress function here, something like get_post($my_id); it works great.
But, the same function doesn’t return results if I insert it after this mysql call:
mysql_select_db($dbname);Which is a problem since I need it to be included after that call.
Any thoughts on why? Is there anything I can do to get a post after I connect to the other database? Closing the mysql connection doesn’t change anything, unfortunately.
Thanks in advance
- The topic ‘Themes & functions outside wordpress & mysql_connect’ is closed to new replies.