Title: use as template function
Last modified: August 30, 2016

---

# use as template function

 *  [greencrest](https://wordpress.org/support/users/greencrest/)
 * (@greencrest)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/use-as-template-function/)
 * I want to add this function to a template page that shows all the posts within
   a category. Can I add this to the template or is the shortcode only available?
 * [https://wordpress.org/plugins/email-before-download/](https://wordpress.org/plugins/email-before-download/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [dtynan](https://wordpress.org/support/users/dtynan/)
 * (@dtynan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/use-as-template-function/#post-6604120)
 * I’m not quite sure exactly what you mean by template page — based on the description,
   I’m assuming it’s a dynamically created page via your theme or some plugin where
   you define the layout in advance in a template or maybe in a settings page or
   something like that. If that’s the case, then yeah it’s not gonna work. EBD is
   based off that shortcode. If you look around line 111 of email-before-download.
   php you’ll see a function where it parses the shortcode for the attributes and
   continues from there. And, beyond that, at some point it will do a string replace
   into the contents of the wordpress page (putting in the download link or whatever).
   Plus, there’s some ajax that happens in there too. I think it would be quite 
   difficult to make it work “inside” some other plugin or special template or page
   or dynamic page type thing.
 *  Thread Starter [greencrest](https://wordpress.org/support/users/greencrest/)
 * (@greencrest)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/use-as-template-function/#post-6604154)
 * There was a post 2-3 years ago asking for the same thing (place the function 
   in the php file) and the plugin author would consider it. It looks like either
   he decided against it or couldn’t get it to work. Thanks. I’ll have to look at
   other options.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘use as template function’ is closed to new replies.

 * ![](https://ps.w.org/email-before-download/assets/icon-256x256.jpg?rev=1813522)
 * [Email Before Download](https://wordpress.org/plugins/email-before-download/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-before-download/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-before-download/)
 * [Active Topics](https://wordpress.org/support/plugin/email-before-download/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-before-download/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-before-download/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [greencrest](https://wordpress.org/support/users/greencrest/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/use-as-template-function/#post-6604154)
 * Status: not resolved