WP2.5 problem with have_posts function
-
Can somebody test the following code and let me know what the outcome is? I have some custom code that extracts recent posts from different blogs (seperate WP installs) and displays them on a page outside the blog. But since I upgraded to 2.5, the have_posts function returns nothing even though there are posts in the blog. Put this test code in a php file and put in your main blog diretory, and then call it and let me know if anybody gets a “1” back from have_posts:
require('wp-blog-header.php'); $myid=10; //put a post id here that you know is valid $mytest = get_post($myid); echo "Known good post id ".$myid." returns: ".$mytest->post_title; $mytest = have_posts(); if ($mytest=="") { $mytest="nothing"; } echo " and have_posts() returns: ".$mytest;
The interesting thing is that within ‘the loop’ on my blog have_posts works fine, but from within this program (using wp-blog-header) it does not appear to be working. This code worked fine on WP 2.3
Thanks to anybody that can test this.
- The topic ‘WP2.5 problem with have_posts function’ is closed to new replies.