0
I’m making a static site, where all the files are in PHP, however this site has a blog that should be manageable by Wordpress, then you ask me and pro what not to do everything by Wordpress? because it is rsrsr order are orders right.
Then I had the idea to create a folder called "news" where I will install Wordpress, so it will be domain/news.
Only that I need to display the last two news on the home page, ie outside of Wordpress, I know I will have to create a file to connect to the database and do the include na index.php and write a sentence in SQL, but I am very lay in this, could give me a light?
Pretty-permalinks is the same as friendly url right? then you mean that with this I can use the native sql functions of Wordpress on any page outside Wordpress? I will already test how it works
– Sérgio Machado
this, url friendly. You won’t be able to use the native functions of Wordpress. What you can do is requests for the
endpoints
of the API, which will return you parts of the content - like the one I showed you. The link has all theendpoints
available and examples of how to make queries.– Ricardo Moraleida
In fact it is simply as if you are consuming an external webservice, you make requests and receive answers.
– Ricardo Moraleida
I got :D I open his return with that Postman program that organizes all the json code and it doesn’t show the featured image of the post, would you tell me?
– Sérgio Machado
It will not show the image, it will only bring the ID and you need to make another request to fetch this image by the ID. Open another question with that question if you need.
– Ricardo Moraleida