Title: numeric list sorting &#8220;1&#8221; &#8220;*1&#8221;
Last modified: May 25, 2021

---

# numeric list sorting “1” “*1”

 *  [verdichtung](https://wordpress.org/support/users/verdichtung/)
 * (@verdichtung)
 * [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/)
 * hi xnau,
    after nearly two years i have to update the page with the pdb-plugin
   and the updating to 1.9.7.1 from 1.9.3.14 was a little… but now almost everything
   works fine again. almost, because i have to sort a list by numbers, but for some
   reason i can not use “01” to “09” but have to use “1” to “9” in my records. the
   old version did this with `orderby="nummer*1"` but with the updated one it isn’t
   working like this (showing no list at all with the “*1”).
 * i hope, it is possible to sort the list like “in former times” 😉
 * all the best,
    michael.
    -  This topic was modified 5 years ago by [verdichtung](https://wordpress.org/support/users/verdichtung/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/#post-14482658)
 * What type of field is your “nummer” field? If you want to use leading zeroes,
   the field must be a text-line field. Numeric fields will not allow a number to
   begin with 0, only text fields can do that.
 * If you want to order numerically, you must use a numeric field for that, but 
   you cannot have leading zeroes in that case. This was enforced a long time ago,
   there is no going back, sorry.
 *  Thread Starter [verdichtung](https://wordpress.org/support/users/verdichtung/)
 * (@verdichtung)
 * [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/#post-14485504)
 * thanks for your answer. i don’t want “01” instead of “1”. the “nummer” field 
   was a text-line field and the list with `orderby="nummer*1"` was ascending like:
   
   1… 2… 3… … 10… 11… 12… etc. after the update, the `*1` workaround is no longer
   working (no list displayed) and when i simply use `orderby="nummer"` the list
   is like: 1… 10… 11… … 19… 2… 20… 21… etc. and there is no difference when i change
   the “nummer” field to a numeric field.
 * i remember, i had the problem when i first used pdb with this website… perhaps
   we can solve it again.
 * (i’m working “offline” for the changes, so i can’t show you the lists – sorry)
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/#post-14491560)
 * Changing the field to a “numeric” type will change how the sort works, it will
   sort numerically instead of alphabetically.
 * It is important to understand that “orderby” should get the name of the field.
   In your example, you’re putting a number there, it should be the name of the 
   field you want to sort the list by. This is why it’s not giving you the sort 
   you want.
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/#post-14491749)
 * OK, yes, that template should be updated…thanks for letting me know that was 
   missing.
 * You can add this yourself if you set it up as a [custom template](https://xnau.com/work/wordpress-plugins/participants-database/participants-database-documentation/pdb-templates/?swcfpc=1),
   then add the fieldname-based class to the template.
 * Change:
 * `<div class="pdb-field" >`
 * to:
 * `<div class="pdb-field <?php echo $this->field->name() ?>-field" >`
 * I will update that template soon if you don’t mind waiting a little.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘numeric list sorting “1” “*1”’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

 * [list](https://wordpress.org/support/topic-tag/list/)
 * [numeric](https://wordpress.org/support/topic-tag/numeric/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 4 replies
 * 2 participants
 * Last reply from: [Roland Barker](https://wordpress.org/support/users/xnau/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/numeric-list-sorting-1-1/#post-14491749)
 * Status: not resolved