Forums

[Plugin: Custom Post Template] No drop-down to select different template (3 posts)

  1. vhgdesign
    Member
    Posted 5 months ago #

    Hi,

    I've installed the plug-in and made new single-new.php, which is copy of single.php. The problem is that I can't see drop-down to select different templates in admin. The php is 5.1.6 and I have also

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

    Any idea where the problem can be?

    Thanks
    Vel

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

  2. ronaldb73
    Member
    Posted 1 month ago #

    I have the same problem, no drop down menu.
    But: when I use it on another theme it does work, what could cause my theme (VN-News) to mess with this plugin?

  3. ronaldb73
    Member
    Posted 1 month ago #

    found a different solution.
    I've added the following code to my themes functions.php:
    add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->term_id}.php") ) return TEMPLATEPATH . "/single-{$cat->term_id}.php"; } return $t;' ));

    now when i create a single-xx.php (where xx is the ID of the category) all posts in this category use the single-xx.php instead of single.php.

Reply

You must log in to post.

About this Topic