- This topic has 6 replies, 2 voices, and was last updated 7 years, 8 months ago by
s1r0n.
-
AuthorPosts
-
-
June 3, 2014 at 2:16 pm #1793
s1r0nMemberI am trying to create a custom post. Code is below. Everything seems to work except the post edit box and title box doesn’t show up. The custom status appear though. which is weird. am I missing something in this code?
add_filter('piklist_post_types', 'my_custom_posts'); function my_custom_posts() { $post_types['articles'] = array( 'post_states' => true ,'labels' => piklist('post_type_labels', 'Articles') ,'title' => __('Articles') ,'public' => true ,'rewrite' => array( 'slug' => 'articles' ) ,'capability_type' => 'post' ,'edit_columns' => array( 'title' => __('Article Title') ,'author' => __('Author') ) ,'supports' => array( 'author' ,'revisions' ) ,'hide_meta_box' => array( 'slug' ,'comments' ,'commentstatus' ) ,'status' => array( 'draft' => array( 'label' => 'New' ) ,'submittoeditor' => array( 'label' => 'Submit to Editor' ) ,'openforreview' => array( 'label' => 'Open for Review' ) ,'published' => array( 'label' => 'Published' ) ,'rejected' => array( 'label' => 'Rejected' ) ) ); -
June 3, 2014 at 2:20 pm #1794
s1r0nMemberI’m guessing this has to do with the overlay glitch I posted on as well. when you look at the source it seems to be all there, but its just not rendering in the browser
-
June 3, 2014 at 8:24 pm #1796
SteveKeymasterYou’re only supporting author and revisions here:
,'supports' => array( 'author' ,'revisions' )If you want title and editor you need to declare it like this:
,'supports' => array( 'author' ,'revisions' ,'title' ,'editor' )Or not use the
supportsparameter at all to get the WordPress defaults. -
June 3, 2014 at 9:32 pm #1797
s1r0nMemberthat fixed it up. i’m still not getting the author field though. so I can’t select an appropriate author for the article
-
June 3, 2014 at 9:36 pm #1798
s1r0nMemberi’m also not able to get the comments either
-
June 4, 2014 at 6:37 am #1799
SteveKeymasterAUTHOR
I just tested this code and I’m getting the author box, so check the Screen Options at the top of the page and make sure it’s there.COMMENTS
Make sure they are added to thesupportparameter, and remove them from here:,'hide_meta_box' => array( 'slug' ,'comments' ,'commentstatus' ) -
June 4, 2014 at 9:51 am #1800
s1r0nMemberthat did the trick.
you folks have a rockin plugin here. I love this
-
-
AuthorPosts
- You must be logged in to reply to this topic.