Title: Using shortcode in template
Last modified: September 1, 2016

---

# Using shortcode in template

 *  [iluvpinkerton](https://wordpress.org/support/users/iluvpinkerton/)
 * (@iluvpinkerton)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/using-shortcode-in-template-3/)
 * I saw the other ticket about this but I’m afraid my template code is way too 
   long and complex to assign it a variable. Is that the only way to be able to 
   use this shortcode in a template?
 * [https://wordpress.org/plugins/content-protector/](https://wordpress.org/plugins/content-protector/)

Viewing 1 replies (of 1 total)

 *  [K. Tough](https://wordpress.org/support/users/kjvtough/)
 * (@kjvtough)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/using-shortcode-in-template-3/#post-7679899)
 * Hi, iluvpinkerton.
 * That’s probably the easiest way, logic-wise, but it’s not necessary. Te important
   thing is being able to call the shortcode using WordPress’s `do_shortcode()` 
   function. What is it that you are trying to do?

Viewing 1 replies (of 1 total)

The topic ‘Using shortcode in template’ is closed to new replies.

 * ![](https://ps.w.org/content-protector/assets/icon-256x256.png?rev=2206760)
 * [Passster - Password Protect Pages and Content](https://wordpress.org/plugins/content-protector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-protector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-protector/)
 * [Active Topics](https://wordpress.org/support/plugin/content-protector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-protector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-protector/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [K. Tough](https://wordpress.org/support/users/kjvtough/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/using-shortcode-in-template-3/#post-7679899)
 * Status: not resolved