Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 17 '11 at 11:36

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.