WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Custom Post Template Not Being Applied

[Resolved] Custom Post Template Not Being Applied

  • I have installed and activated the plugin and created a custom template. I have assigned the custom template to a particular post and can see the custom field that was created on the post.
    However, the single.php template is being applied rather than my custom template.

    my custom template file name is trails_single.php.
    At the top of the file I have:

    <?php
    /*
    Template Name Posts: trails_single
    */
    ?>

    The remainder of the file is a copy of my single.php code with the addition of an echo statement to let me know which template I’m actually looking at.

    Any ideas???
    Thanks,
    joe

    http://wordpress.org/extend/plugins/custom-post-template/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Well… I found a workaround but it is not pretty!
    I am using a child theme of the arras theme.
    I already have a child single.php in my child theme.
    What I discovered was that if I put the new custom post template file in my child theme directory it is discoverd by the plugin but it is not applied.
    Just as an experiment I tried putting another copy of the custom post template inside the parent theme and guess what… it is now applied.

    This is not good though because a parent theme upgrade could potentially wipe out my custom post templates 🙁
    joe

    One step further…
    I discovered that the custom post template is both recognized and used if it is inside the parent theme even if not present at all inside the child theme that is being used.
    This seems counter intuitive to me.
    joe

    I think I’ve got it working in a child theme now. I replaced several instances of “TEMPLATEPATH” with “get_stylesheet_directory()”
    TEMPLATEPATH returns the path to the parent directory whereas get_stylesheet_directory() returns the path to the child.

    There is one instance of get_template_directory(), but it seems to be ok because it is accompanied by get_stylesheet_directory().

    joe

    sierrajoe – this has just started happening to me with the arras theme. I’m not able to get it to use the custom theme at all even if I put it in the arras directory.

    I can select it in the page editing interface but it will not use the selected theme.

    I’m going to go see what I can find on the arras site.

    http://wordpress.org/extend/plugins/custom-post-template/download/

    The developmental version works w/ child themes (without the hackery I posted elsewhere)…. so I suspect it will work in the next version.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Custom Post Template Not Being Applied’ is closed to new replies.
Skip to toolbar