Title: [Plugin: Custom Post Template] getting template name
Last modified: August 20, 2016

---

# [Plugin: Custom Post Template] getting template name

 *  [mkunysz](https://wordpress.org/support/users/mkunysz/)
 * (@mkunysz)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-getting-template-name/)
 * Hi there,
 * I have a question concerning this plugin, is it possible to get value of which
   template post is using? Something like get_post_template(). I would like to style
   post differently also in the index.php loop, not only on the single.php page.
 * thanks in advance!
    keep up with a good job, Marcin
 * [http://wordpress.org/extend/plugins/custom-post-template/](http://wordpress.org/extend/plugins/custom-post-template/)

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

 *  [isellsoap](https://wordpress.org/support/users/isellsoap/)
 * (@isellsoap)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-getting-template-name/#post-2871172)
 * I’d also like to know that.
 * Thanks a lot for any advice.
 *  [jamespaulsandel](https://wordpress.org/support/users/jamespaulsandel/)
 * (@jamespaulsandel)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-getting-template-name/#post-2871180)
 * The template is stored in wp_postmeta, with the meta_key of ‘_wp_page_template’,
   so your best bet is:
 * $template = get_post_meta($post->ID, ‘_wp_page_template’, true);
 * Word.
 *  [jamespaulsandel](https://wordpress.org/support/users/jamespaulsandel/)
 * (@jamespaulsandel)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-getting-template-name/#post-2871181)

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

The topic ‘[Plugin: Custom Post Template] getting template name’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-post-template.svg)
 * [Custom Post Template](https://wordpress.org/plugins/custom-post-template/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-template/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-template/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-template/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-template/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-template/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [jamespaulsandel](https://wordpress.org/support/users/jamespaulsandel/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-post-template-getting-template-name/#post-2871181)
 * Status: not resolved