I have spent several days trying to solve the following problem:
I am developing a business directory using Wordpress, each business is a post that contains several fields such as your name, contact options, etc. Among them, there is a field that asks for the instagram URL. Now, how can I display the feed (Getting the URL from the field in the backend) in the frontend?
As expected, there will be more than one trade. Therefore, in each post the value of the field is different, which should make it show the feed corresponding to each merchant.
I am working with Elementor and a template created with the theme builder it provides. There would be no problem installing extra plugins. There would be no problem modifying code either. How would you solve?
From already thank you very much.
EDIT 1 I have tried all kinds of plugins, because I understand the code, but here it was difficult for me. Basically, I have found plugins that allow me to specify the user of the feed via Elementor, but it does not allow me to retrieve it from my custom fields (to include it in the template). So, you could only put one user for all the merchants, and that is not the idea.
You can use instagram Oembed API https://developers.facebook.com/docs/instagram/oembed
This allows you to embed an instagram feed using a URL like this:
You can get the content using
Obtaining a structure like this:
Where
$result['html']
will contain the HTML of the feed. By embedding this code in your page, it will invoke the embed.js library to perform the rest of the visuals.