Custom Fields
Re-Envisioned
Support General Change the location of the custom fields in the taxonomy

  • Creator
    Topic
  • #31050
    Resolved MartinJaneek
    Participant

    Hi, I added some custom fields for taxonomy - product category (created by woocommerce). It is possible to change the location of these fields? I have seo plugin the RankMath and the custom fields were displayed after the RankMath fields. I need show them before RankMath fields or between existing woocommerce fields.

    For post type I used Context https://docs.metabox.io/creating-meta-boxes/#contexts , but it doesn´t work for taxonomy.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #31075
    Long Nguyen
    Moderator

    Hi Martin,

    It's really hard to change the priority of meta boxes with PHP code when editing the term. You can try to use the CSS code to re-order them. For example:

    .wp-admin.taxonomy-product_cat form#edittag {
        display: flex;
        flex-wrap: wrap;
    }
    
    .wp-admin.taxonomy-product_cat .rank-math-metabox-wrap {
        order: 10;
    }
    
    .wp-admin.taxonomy-product_cat .edit-tag-actions {
        order: 15;
    }
    
    .wp-admin.taxonomy-product_cat .rwmb-meta-box {
        width: 100%;
    }
    

    Screenshot https://share.getcloudapp.com/04ux46r5

    FYI, context setting only works with the post meta box, it does not work with the term meta box.

    #31093
    MartinJaneek
    Participant

    Hi Long.
    Thank you for your answer. Solve it with css is a good idea, it works as I expected.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.