Hi
So this question just crossed my mind because I’m creating a very basic personal blog theme. Should I use the built-in WP PHP functions to get the blogs and then serve the final design and everything to the user, or should I serve an empty div element to the user, and then use JS to make an API request to fetch the data and render into the empty div element (similar to React0?
I think it’s best to use PHP since using JS means making 2 requests to the server instead of 1, and also in PHP, I can use the i18n functions and all the other PHP/WP functions to manipulate data before outputting.
What do you think? Thanks
[ad_2]
I’d say just use php unless you have a theme that comes with js api stuff built in.