Trouble with AJAX & get_posts()
-
I’ve written a short script to be called by Prototype’s Ajax object and return a list of posts using the get_posts() function. My script lives in the wp-includes directory.
When I make the AJAX call to the script, I get the response “Fatal error: Call to undefined function get_posts()”, so I assume I must include wp-include/post.php (where the function is defined) in my script. But when I do this I get another error, saying that I can’t redefine functions defined in wp-includes/post.php, so the file must already have been included as I assumed initially.
I’m confused by this… can anybody suggest a solution? Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trouble with AJAX & get_posts()’ is closed to new replies.