WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Template
getting template name (4 posts)

  1. mkunysz
    Member
    Posted 1 year ago #

    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/

  2. isellsoap
    Member
    Posted 1 year ago #

    I’d also like to know that.

    Thanks a lot for any advice.

  3. jamespaulsandel
    Member
    Posted 1 year ago #

    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.

  4. jamespaulsandel
    Member
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.