Tagged: category
- This topic has 7 replies, 2 voices, and was last updated 6 years, 11 months ago by
Steve.
-
AuthorPosts
-
-
March 11, 2015 at 1:46 am #3436
RockMemberHow can I create meta fields for different category? thank you!
I have cat1 and cat2
and I want to create meta filds1 for cat1, and meta fields2 for cat2. two fields are different. -
March 11, 2015 at 5:49 am #3437
RockMemberI create a php file “field-group1.php” in terms folder
and put this in the header:
/*
Title: My Term Metabox
Description: My cool new metabox
Taxonomy: assistant
Capability: manage_options
Locked: true
New: true
Collapse: true
*/
It does not work.
I have a category named ‘assistant’, and I want this meta fields just show when I add new post to ‘assistant’ category.
what should I do? Thank you! -
March 11, 2015 at 8:54 am #3438
-
March 11, 2015 at 9:14 am #3439
RockMember@Steve: Thank you for your reply. Hope the attached screenshot can explain what I want to do.
I want to have custom fields only for specific category, in the attached screenshot, when I chose the specific category for a new post(arrow 1), the custom fields “my meta fields” will show there(arrow 2), otherwise, the custom fields “my meta fields” will not show.Attachments:
You must be logged in to view attached files. -
March 12, 2015 at 9:32 am #3450
-
March 12, 2015 at 11:18 am #3453
RockMember@Steve: Yes,that’s fine, please write some code for me. thank you!
It would be better if the meta box can show automaticly when I chose the specific term.I think this is also doable, because Advanced custom fields plugin can -
March 12, 2015 at 11:21 am #3454
RockMemberI mean without saving the post, the meta box will show automaticly when I just select the term
-
March 12, 2015 at 4:44 pm #3464
SteveKeymaster@rock– You can automatically show FIELDS without saving, but not META BOXES. To show a field:
1) Instead of using the default WordPress taxonomy box, please build one with Piklist.
2) Then conditionally hide/show the field based on the selected value.
Let us know if this works for you.
-
-
AuthorPosts
- You must be logged in to reply to this topic.