- This topic has 6 replies, 3 voices, and was last updated 7 years, 11 months ago by
bospaddestoel.
-
AuthorPosts
-
-
March 3, 2014 at 7:50 am #1486
bospaddestoelMemberIk have just started a piklist tutorial to make a plugin, I added code to make a custom post type. The problem is dat I can’t add an item or edit one as those pages are blank (except for the title). As soon as I activate the twentyfourteen theme all is normal. But with other themes the pages are blank again. The demo piklist is working though. Do I need to activate something in the theme I am using?
-
March 3, 2014 at 1:06 pm #1487
SteveKeymasterPlease make sure you are using the appropriate folder structure for your theme >
If so, please post some of your code so we can take a look.
-
March 6, 2014 at 5:14 am #1502
bospaddestoelMemberI used it as a plugin and added the same folder structure to the plugin. So not in the theme itself.
the code that is in the mainfile of the plugin:
add_filter('piklist_post_types', 'onderwerp_post_type'); function onderwerp_post_type($post_types) { $labels = array( 'singular_name' => 'onderwerp', 'search_items' => __( 'Zoek Onderwerpen' ), 'all_items' => __( 'Alle Onderwerpen' ), 'add_new' => __('nieuw onderwerp'), 'add_new_item' => __('nieuw onderwerp'), 'new_item' => __('nieuw onderwerp'), 'view_item' => __('Bekijk onderwerp '), 'edit_item' => __( 'Wijzig onderwerp' ), 'menu_name' => __( 'Onderwerpen' ), 'not_found' => __('Niet gevonden'), 'not_found_in_trash' => __('Niet gevonden in prullenbak'), 'parent_item_colon' => __('Hoofd onderwerp'), 'menu_name' => __('Onderwerpen') ); $post_types['onderwerp'] = array( 'labels' => $labels //piklist('post_type_labels', 'Onderwerp') ,'title' => __('Voeg een titel toe') ,'public' => true ,'rewrite' => array( 'slug' => 'onderwerp' ) ,'supports' => array( 'author' ,'revisions' ) ,'hide_meta_box' => array( 'slug' ,'author' ,'revisions' ,'comments' ,'commentstatus' ) ); return $post_types; } -
March 6, 2014 at 5:49 am #1503
bospaddestoelMemberthe folder structure is :
wp-content plugins myplugin-piklist parts admin-pages dashboard help media meta-boxes settings terms updates users widgets workflows myplugin-piklist.php -
March 6, 2014 at 10:37 am #1505
JasonKeymasterI don’t know if this is causing the issue, but I’m confused by you’re both adding support for and removing the meta box for author and revisions.
-
March 6, 2014 at 12:11 pm #1507
SteveKeymaster@bospaddestoel– A few things:
1) @Jason is correct. You are adding support for “author”, and then using
hide_meta_boxto remove it.
2) In the plugin header please includePlugin Type: Piklist, as specified here >
3) If you want meta boxes and fields to show up, then you need to create them. Use this tutorial to get started. -
March 7, 2014 at 7:50 am #1528
bospaddestoelMemberah ok thank you , I will try that, I copied a piece of code without really looking at the meta boxes.
-
-
AuthorPosts
- You must be logged in to reply to this topic.