Title: Shortcode [pdb_list orderby=random] not working
Last modified: February 10, 2020

---

# Shortcode [pdb_list orderby=random] not working

 *  Resolved [Hans](https://wordpress.org/support/users/paladin64/)
 * (@paladin64)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-pdb_list-orderbyrandom-not-working/)
 * Hallo,
    after the Last update work shortcode [pdb-list] with the attribut orderby
   =random not longer. not display the list in the fontend. why?
 * i hope somebody can help.
    the display wis random is justly better for the user.
 * thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-pdb_list-orderbyrandom-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-pdb_list-orderbyrandom-not-working/#post-12420427)
 * Thanks for this, I recently made some changes to ensure that values in the shortcode
   were valid, and I forgot to allow “random” as a value for the orderby attribute.
 * You can fix this yourself if you want. In the plugin file classes/PDb_List_Query.
   php on page 252, you’ll find:
 * `if ( !empty( $fields[$i] ) && PDb_Form_Field_Def::is_field( $fields[$i] ) ) {`
 * change that to:
 * `if ( !empty( $fields[$i] ) && PDb_Form_Field_Def::is_field( $fields[$i] ) ||
   $fields[$i] === 'random' ) {`
 * and the”random” sort will work again.
 * this will be fixed in the next release.
 *  Thread Starter [Hans](https://wordpress.org/support/users/paladin64/)
 * (@paladin64)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-pdb_list-orderbyrandom-not-working/#post-12423578)
 * Hallo xnau webdesign,
    thanks for you quickli answer.
 * I do it and everything works, great great great.
 * Thank you very much for your support.
 * Berst regards
 * Hans.

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

The topic ‘Shortcode [pdb_list orderby=random] not working’ 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

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

 * 2 replies
 * 2 participants
 * Last reply from: [Hans](https://wordpress.org/support/users/paladin64/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-pdb_list-orderbyrandom-not-working/#post-12423578)
 * Status: resolved