I have placed my external api call inside the functions.php file in the server and I created a shortcode for the api call.
I'm familiar with React and I was expecting Wordpress to be somewhat similar. For example being able to grab the results, loop, and display in a list/component
sendExternalApiCall().then((res) => {
return (
res.listOfResults.map((item) => {
return <div> item.title </div>
})
)
})
I've tried googling/watching Youtube videos but most examples of dynamic content are using Custom post types, custom field options, but all this is seemingly still very manual effort and I'm having a hard time piecing together how I can grab my list of results from my api e.g.
results = [{title: 'first post'}, {title: 'second post'}]
loop through those results and render then on the page inside a wordpress widget. Am I able to do this or do I have to create a custom widget? I would love to be able to use existing widgets like elementor but I don't know how to integrate them