WordPress: Access a plugin from within a theme

I am creating my own custom wordpress theme, this in general is not the problem.
I would like to use a plugin that is normally used within pages/posts. (NextGen Gallery, to make a sort of slide show between title and posts) but I am unsure what would be the best way to approach this.
I would like to not have to go through the trouble of recreating the code path of how the plugin html is normally generated, but to just use the tags that are normally put into wordpress posts. Is there for example a way to pass them to the right php function the evaluates them and creates the right html from them or is this either not possible or making things too complicated?
Note: The question “WordPress: Accessing a plugin’s function from a theme” is not what I want/mean.

Related posts

Leave a Reply

1 comment

  1. The easiest approach might be to use do_shortcode(); for example:

    <?php 
    echo do_shortcode('[gallery id="1"]'); 
    ?>
    

    You just need to pass the appropriate gallery ID. You can also pass any of the other valid shortcode parameters, such as “columns”, “size”, etc.