0

I need to use list of posts from wordpress in my project to generate XML. I have my own php script. In this script i use

require_once ('wp-blog-header.php');

and i am retrieving list of posts

$myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post );

but in this case i can't use script as XML because there are some extra headers from wp-blog-header.php. Is there any way to include wordpress posts list without headers?

  • do you need to use require_once ('wp-blog-header.php');? You can make a template that can display xml... – Reigel Feb 14 '15 at 17:37
0

i found solution i am using this php code to send headers

header("Content-type: text/xml", true, 200);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.