Tagged: custom fields
July 23, 2012 at 12:11 pm #111
I’m having issues going through your tutorials. I’m trying to create a custom post type “Provider”. I have a child theme so I added the following code in the child theme function.php file.
Then I will need a select meta-box for the post type. So in the child theme, I created piklist/parts/meta-boxes/field-select.php and this is the code in their:
When this code is implemented, nothing shows up in the admin dashboard for me to start adding providers.
Do you see something I’m doing wrong?
July 23, 2012 at 4:35 pm #112KevinKeymaster
It looks like all you were missing was a closing ) on your meta-box field. I have updated the to pastebin’s and posted the links below. They are working and you should be able to just cut and paste. Let me know if you run into anything else.
PS. I added ‘position’ to your field so its wrapped in the correct template (this feature will be easier in a forthcoming release 😉
July 23, 2012 at 7:38 pm #113
I got it working! I got another question. Is their a way to get checkboxes to style like categories in the post sidebar? I know we can add the position to the “side” but it is just a long list of checkboxes rather then a scrollable list. Any ideas?
July 23, 2012 at 7:50 pm #114KevinKeymaster
Great question and so happy to hear you ask 🙂 We actually finished the tab system in WordPress so you can use it in your meta boxes. Check out the following file in the demo add-on for an example of how to use it and let me know if you have any questions (you just need to use the markup, everything else is automatic).
July 23, 2012 at 8:36 pm #115SteveKeymaster
@ehoanshelt- It’s best practice to make the “field” name all lowercase letters and numbers with no spaces or special characters if possible. What you did will work, but this method is a best practice when working with database fields.
‘Alcohol/Drug Counselor’ => ‘Alcohol/Drug Counselor’
WOULD BE BETTER AS:
‘alcohol-drug-counselor’ => ‘Alcohol/Drug Counselor’
I updated Step 4 of our tutorial to reflect this.
July 23, 2012 at 8:50 pm #116
Hey Steve and Kevin,
Thanks for the info! I will take a look at the demo and see if I can pull it off.
Thanks again for the great support!
- You must be logged in to reply to this topic.