arthurdent2003
Member
Posted 9 months ago #
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
arthurdent2003
Member
Posted 9 months ago #
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/
arthurdent2003
Member
Posted 9 months ago #
hi simon,
thank you! I'll give it a try.
AD
d5dhatch
Member
Posted 8 months ago #
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.
@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?
arthurdent2003
Member
Posted 6 months ago #
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
Sorry Arthur, this isn't currently possible with the plugin.
arthurdent2003
Member
Posted 4 months ago #