Roots Discourse

How include/use composer required library

Hello

We want to use this Instagram feed library: https://github.com/pgrimaud/instagram-user-feed and loaded it via

composer require pgrimaud/instagram-user-feed

Now I’m a bit stuck on where to include/autoload the library so we can use it in the templates or helper.php.

Thanks for any input.
Aldo

You should implement new functionality in a plugin (site plugin or dedicated plugin) or the theme (when it is mostly used for displaying data).
In your case I think you should create a new plugin named “Instagram User Feed” and require that library from that plugin and also put the code for using that library, registering Gutenberg blocks, shortcodes, widget, etc.

1 Like