Change the location of the custom fields in the taxonomy

Support General Change the location of the custom fields in the taxonomyResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31050
    MartinJaneekMartinJaneek
    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.

    #31075
    Long NguyenLong 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
    MartinJaneekMartinJaneek
    Participant

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

    Thank you.

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