Support » Plugins and Hacks » [Plugin: Custom Post Template] Metabox dropdown in "Custom post types"

  • Hi There!

    I set up a custom post type- the I missed the dropdown menu to choose the kind of post-template. I just tried it dirts, “add_meta_box” in functions.php

    [Code moderated as per the Forum Rules. Please use the pastebin]

    But now – everytime I enter the post, it shows the default template in the dropdown, even if I selected the “Sold” button – I know – it’s because it is hardcoded. But how can I just make wordpress check, if it is the selected one?

    Thank you!
    AD

Viewing 8 replies - 1 through 8 (of 8 total)
  • anyone?

    Simon Wheatley

    (@simonwheatley)

    Code for the People

    Rather than doing that, try following the instructions here (you’ll need the latest version of the plugin): http://wordpress.org/extend/plugins/custom-post-template/other_notes/

    hi simon,

    thank you! I’ll give it a try.
    AD

    Hi Simon,
    I have custom post type I created with “Custom Post Type UI” plugin called products.

    I put this in my functions.php but I still don’t get the meta box. Anything I’m doing wrong?

    <?php 
    
    /**
     * Hooks the WP cpt_post_types filter
     *
     * @param array $post_types An array of post type names that the templates be used by
     * @return array The array of post type names that the templates be used by
     **/
    function my_cpt_post_types($post_types) {
        $post_types[]='products';
        return $post_types;
    }
    add_filter( 'cpt_post_types', 'my_cpt_post_types' );
    
    ?>

    The plugin works great for standard posts but wont show the metabox on the custom post.

    Simon Wheatley

    (@simonwheatley)

    Code for the People

    @d5dhatch – Are you using the latest version of the plugin? Can you also paste the code you’re using to setup the Custom Post Type, please?

    Dear Simon,

    is there any way to automatically only use custom post type (e.g.) “Love” -> with Custom Post Template “Love”, custom post type “Peace” -> with Custom Post Template and so on.

    So that it automatically uses the specific cptemplate with specific post type?

    I uses this code – but I always have to make a choice:

    function my_cpt_post_types($post_types) {
        $post_types[]='love';
        $post_types[]='peace';
        $post_types[]='war';
    
        return $post_types;
    }
    
    add_filter( 'cpt_post_types', 'my_cpt_post_types' );

    thx!

    AD

    Simon Wheatley

    (@simonwheatley)

    Code for the People

    Sorry Arthur, this isn’t currently possible with the plugin.

    ok – thanks anyway!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Custom Post Template] Metabox dropdown in "Custom post types"’ is closed to new replies.