- This topic has 16 replies, 2 voices, and was last updated 7 years, 7 months ago by
Steve.
-
AuthorPosts
-
-
June 21, 2014 at 12:57 am #1856
msmithMemberI have been working on my first plugin with Piklist, using both the Tutorials and the Demos as examples. I have been able to create a custom post type, along with a meta box with additional fields. From how I understand, in the header of the meta box I included
Post Type: member, but when I go and look at the edit page, I can only see the title box, not my meta box.Please advise where I am going wrong.
-
June 21, 2014 at 12:56 pm #1859
-
June 21, 2014 at 2:00 pm #1860
msmithMemberSure. I have it below.
<?php /* Title: Application Data Description: Data from membership application. Post Type: member */ piklist('field', array( 'type' => 'group' ,'label' => 'Address' //,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'ungrouped_address_1' ,'label' => 'Street Address' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => 'ungrouped_address_2' ,'label' => 'PO Box, Suite, etc.' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => 'ungrouped_city' ,'label' => 'City' ,'columns' => 5 ) ,array( 'type' => 'select' ,'field' => 'ungrouped_state' ,'label' => 'State' ,'columns' => 4 ,'choices' => array( 'AL' => 'Alabama' ,'AK' => 'Alaska' ,'AZ' => 'Arizona' ,'AR' => 'Arkansas' ,'CA' => 'California' ,'CO' => 'Colorado' ,'CT' => 'Connecticut' ,'DE' => 'Delaware' ,'DC' => 'District Of Columbia' ,'FL' => 'Florida' ,'GA' => 'Georgia' ,'HI' => 'Hawaii' ,'ID' => 'Idaho' ,'IL' => 'Illinois' ,'IN' => 'Indiana' ,'IA' => 'Iowa' ,'KS' => 'Kansas' ,'KY' => 'Kentucky' ,'LA' => 'Louisiana' ,'ME' => 'Maine' ,'MD' => 'Maryland' ,'MA' => 'Massachusetts' ,'MI' => 'Michigan' ,'MN' => 'Minnesota' ,'MS' => 'Mississippi' ,'MO' => 'Missouri' ,'MT' => 'Montana' ,'NE' => 'Nebraska' ,'NV' => 'Nevada' ,'NH' => 'New Hampshire' ,'NJ' => 'New Jersey' ,'NM' => 'New Mexico' ,'NY' => 'New York' ,'NC' => 'North Carolina' ,'ND' => 'North Dakota' ,'OH' => 'Ohio' ,'OK' => 'Oklahoma' ,'OR' => 'Oregon' ,'PA' => 'Pennsylvania' ,'RI' => 'Rhode Island' ,'SC' => 'South Carolina' ,'SD' => 'South Dakota' ,'TN' => 'Tennessee' ,'TX' => 'Texas' ,'UT' => 'Utah' ,'VT' => 'Vermont' ,'VA' => 'Virginia' ,'WA' => 'Washington' ,'WV' => 'West Virginia' ,'WI' => 'Wisconsin' ,'WY' => 'Wyoming' ) ) ,array( 'type' => 'text' ,'field' => 'ungrouped_postal_code' ,'label' => 'Postal Code' ,'columns' => 3 ) ) )); piklist('field', array( 'type' => 'text' ,'field' => 'member_phone_number' ,'label' => 'Phone Number' )); piklist('field', array( 'type' => 'text' ,'field' => 'member_email' ,'label' => 'member_phone' ) ); /* piklist('shared/code-locater', array( 'location' => __FILE__ ,'type' => 'Meta Box' ));*/ ?>Thanks for your help
Michael -
June 21, 2014 at 3:21 pm #1861
SteveKeymasterDid you try enabling wp_debug? Guessing there is a syntax error somewhere.
-
June 21, 2014 at 7:12 pm #1865
msmithMemberI just enabled wp_debug, but not seeing any messages when I go to the add screen.
-
June 21, 2014 at 7:53 pm #1866
SteveKeymasterPlease post the code for creating your post type.
-
June 21, 2014 at 7:53 pm #1867
SteveKeymasterPlease post the code for creating your post type.
-
June 21, 2014 at 8:15 pm #1868
msmithMemberadd_filter('piklist_post_types', 'members_post_types'); function members_post_types($post_types) { $post_types['members'] = array( 'labels' => piklist('post_type_labels', 'Members') ,'title' => __('Add a new Member') //,'menu_icon' => piklist_admin::responsive_admin() == true ? plugins_url('piklist/parts/img/piklist-icon.svg') : plugins_url('piklist/parts/img/piklist-icon.png') //,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'supports' => array( 'title', 'revisions', ) ,'public' => true ,'has_archive' => true ,'rewrite' => array( 'slug' => 'member' ) // ,'capability_type' => 'post' ,'edit_columns' => array( 'title' => __('Member') //,'author' => __('Assigned to') ,'post_states' => __('Status') ) ,'hide_meta_box' => array( 'slug' ,'author' ) ,'post_states' => true ,'status' => array( 'draft' => array( 'label' => 'Inactive' ,'public' => true ) ,'active' => array( 'label' => 'Active' ,'public' => true ) ) ); return $post_types; }Thanks for your help
Michael -
June 21, 2014 at 8:22 pm #1869
SteveKeymasterYou registered the post type members ( plural), but the comment block is set to member (singular). They need to match.
-
June 21, 2014 at 8:43 pm #1870
msmithMemberI have made them match (now they are all members) but it’s still not showing. Is there something else I might need to correct?
-
June 21, 2014 at 8:48 pm #1871
SteveKeymasterMake sure your folder structure is correct >
-
June 21, 2014 at 9:02 pm #1872
msmithMemberI just went through and everything has t he correct structure.
-
June 21, 2014 at 9:18 pm #1873
SteveKeymasterIf you want to zip up the plugin/theme and email to [email protected], we can take a look.
-
June 21, 2014 at 9:36 pm #1874
msmithMemberI just sent the email.
Michael
-
June 21, 2014 at 9:47 pm #1875
SteveKeymasterGot your email and zip. You just need to add:
Plugin Type: Piklistto the comment block of your main plugin file, in your case members.php. The full tutorial is here >Let me know if you still have issues, but it’s working fine for me.
-
June 21, 2014 at 10:44 pm #1876
msmithMemberThanks for your help. I thought I went back and checked that, but apparently not.
-
June 22, 2014 at 10:04 pm #1880
SteveKeymasterAwesome! Glad you love Piklist. Let us know if you need help with anything else.
-
-
AuthorPosts
- The topic ‘Meta Box Not Showing’ is closed to new replies.