scmccarthy22
scmccarthy22

Reputation: 631

Wordpress plugin shortcodes in page html

I'm somewhat new to Wordpress. I'm primarily a front-end web designer, and I use Wordpress plugins for things like dynamic content, forms and really anything a client requests that I do not know how to write code for. Unfortunately, I share the frustration of many designers/developers who complain about Wordpress' html sanitization. Thus, I write the majority of my html directly onto the page templates rather than using the Wordpress editor. I only use the Wordpress editor for small sections of my pages where I need to insert a plugin shortcode -- for a form or something. This works well until I need to use multiple plugins on one page. For instance, if I need a form plugin at the top of a page and a google map at the bottom, then I have to code all of the html in between those two elements into the Wordpress editor, which I would rather avoid.

My question -- is there a way to use Wordpress plugins in the page template html instead of using the shortcodes in the Wordpress editor? If I had it my way I'd never have to use the Wordpress editor for non-blog content.

Thanks, Scott

Upvotes: 0

Views: 6671

Answers (1)

Faris M
Faris M

Reputation: 540

Use wordpress do_shortcode();

e.g. echo do_shortcode('[gallery autoplay=no]');

Upvotes: 3

Related Questions