I need to use only wp_posts from another db Wordpress

Asked

Viewed 20 times

-1

I have 2 sites with different themes in Wordpress:

Website 01: MAIN

Site 02: Secundario

(I need the site 02 access the database site 01 and take the posts from there always)

I don’t know how to do this, any suggestions?

1 answer

0

Unless you have a great justification to load the comic book directly, use the REST API wordpress native:

For example:

GET https://site01.teste/wp-json/wp/v2/posts

or

$posts = wp_remote_get( 'https://site01.teste/wp-json/wp/v2/posts', $args );

Returns the most recent articles from site01, the same content that would be default on its main page.

  • Hello, thank you for responding. In which case file should I make the notification?

  • modifying? ***

Browser other questions tagged

You are not signed in. Login or sign up in order to post.