Accessing WordPress categories from outside
- by John
So, I have a client that needs all the categories from their blog to be displayed on their homepage. The WordPress blog is in its own directory, /blog. I have tried the following code (taken from a tutorial, I changed the path to fit clients site):
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('blog/wp-load.php');
query_posts('showposts=1');
?>
But this code just redirects me to the install file of WordPress (it actually wrongly redirects me). It goes to http://www.site.com/wp-admin/install.php instead of http://www.site.com/blog/wp-admin/install.php.
Is there a better way than this method? I would pull in the categories from the database table, but I do not currently have access.
Thanks!