0

I wanted to expand my knowledge of WP and the rest-API interested me. I have my main site (site 1) with a custom rest API endpoint and another site (site 2) which will get the data from site 1 (both running WordPress).

How would I bring over the same slug structure and create a post template for posts from site one eg: https://site1.com/posts/example to https://site2.com/posts/example getting the data from site1 and showing it on a single post template on site2.

Is it also possible to also bring the taxonomies over through the rest API endpoint from site1 over to site2?

1 Answer 1

0

You can bring the post data and term data over via the REST API, but you still have to register custom post types and custom taxonomies on the other site.

Likewise the REST API doesn't provide you with permalink settings or theme templates, those need to be provided on the other site too.

You're responsible for setting up the slug/permalink structure on site 2, that's not data you can just pull from the REST API. You also need to set up the templates and assign them in your code or do it manually.

Ideally, you pull the data in from the REST API by making a request, then store that data by creating a post and giving it the same properties and content as the original. The REST API is just an API for exposing data, the actual processing and retrieval of that data is still up to you, as is how it's displayed.

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.