I am trying to call plugins on a theme page. Specifically I am after the ‘User Avatar’ theme but their will be other later.
How do I call a plugin on a theme?
Presumable something linke <?php
…plugin name… ;?>
but that isn’t it. Any ideas.
Marvellous
You must check the documentation of the plugin.
<? do_shortcode('[plugin_shortcode]'); ?>
<? my_plugin_function(); ?>
Other options would be
function_exists( ‘first_loaded_plugin_fn’ ) AND do_something();
class_exists( ‘initial_plugin_class’ ) AND do_something();
The best chance is the callback function from
register_activation_hook( $file, $function );
if the plugin does not only offer a template tag or similar basic functionality.or:
Some option from the plugin that get’s added on init/activation:
or:
Check if the plugins_loaded hook has some action (<– link)
You’ll hacve to take a closer look at the returned result. The result may contain the priority too.
you could do it through shortcode like keatch said or you could create a function in your plugin that would be called from within your theme.
look here, section 7. Creating the user function
you are supposed to put the output of your plugin into that function (keep in mind that you should use return to print out the output, and not echo, since with echo you don’t have enough control over where your output will end up).