Tagged: 

Viewing 7 reply threads
  • Author
    Posts
    • #3436
      Rock
      Member

      How 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.

    • #3437
      Rock
      Member

      I 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!

    • #3438
      Steve
      Keymaster

      @rock– Welcome to the Piklist Community!

      These fields will show up when you edit a term. Is that what you want?

      If not, please post a screenshot of where you want the fields to show.

    • #3439
      Rock
      Member

      @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.
    • #3450
      Steve
      Keymaster

      @rock– So you want a specific meta box to show if you choose a specific term. Ok, this is doable. However, the user will have to select the term and save the post… then the box will show up.

      If that’s fine we can write some code for you. Let me know.

    • #3453
      Rock
      Member

      @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

    • #3454
      Rock
      Member

      I mean without saving the post, the meta box will show automaticly when I just select the term

    • #3464
      Steve
      Keymaster

      @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.

Viewing 7 reply threads
  • You must be logged in to reply to this topic.