• Resolved berttervoert

    (@berttervoert)


    I created a custom post type and a custom meta box with cmb2. In this metabox I have a small text field for the distance. I wanted to display km after this field using ‘after’ or ‘after_field’, but first the text defined by ‘desc’ (description) gets shown and after that the km.

    My question is: is there a way I can alter the order of this being displayed? So km right after the small text field and only then the description (or even below the small text field). I have been looking through all the topic here but found no similar question. (I did found the answer to several different questions I had, so that is all good.)

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Justin Sternberg

    (@jtsternberg)

    You could skip the desc parameter, and just put it all in the after_field parameter:

    'after_field' => ' km <span class="cmb2-metabox-description">Optional field description.</span>'

    Something like that.

    Thread Starter berttervoert

    (@berttervoert)

    Ok, thanks that works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I alter the order of ‘desc’ and ‘after’ ?’ is closed to new replies.