I’m using woocommerce (which does not matter that much for my question) and I want to generate all products (posts) in a special category as JSON, and I only want some values from the product (post) and have some special names for the values. SO… What’s best practice for generate custom JSON from WP posts?
One thought is to make a page and use a page as URL to the JSON, so therefore I’m thinking of making a template just for this and set header('Content-Type: application/json');
and all that and just exclude the usual wp theming stuff, but I have the feeling that this can be done in a better way?