Having a custom post type "Articles" with custom taxonomies "volume, issue, authors, Keywords ... etc". I need to add a button on the single post type front-end to let visitors download an xml file of the article that they read. This means an xml file about only the article being read. an example of such issue can be found on this link: https://stephenpalmer.wordpress.com/article/article-the-practice-model-of-coaching-towards-a-solution-focused-approach/ it's generated using the Annotum wordpress theme, & it includes specific data from the specific article. My question is: How can I make my theme do the same? I've tried several xml plugins but they didn't provide me with a solution of this issue. Any suggestions please?

1 Answer 1


Typically when you want to create an extra representation or variation it implies extending URL a bit and treating that case differently.

The easiest way in WP for that are rewrite endpoints.

However the ease is relative you still need to handle with code the changes in a query and how to produce output. WP doesn't have an easy native concept of multiple representations of content so there aren't really turn-key solutions for that.

  • thanks a lot for replying. I tried to use rewrite endpoints and got url like (www.my-site.com/article/article-title/xml/). but what i have to do next: calling a custom template for xml? how to build it in a way that can generate xml data? or what?
    – nisr
    Aug 29, 2015 at 0:50
  • @nisr there is no "canonical" way to do that. This gets you the query var to detect and from there you need to handle different template (or variations in same template) with your won code.
    – Rarst
    Aug 29, 2015 at 9:14
  • thanks @Rarst. I tried something based on annotum theme features. but i had a problem. Can you please read this post: wordpress.stackexchange.com/questions/200041/…
    – nisr
    Aug 29, 2015 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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