It is current not possible to change the default search order.
OK. Thanks. I went looking and found the bit of code in short_codes.php that determines the default search order and changed it manually. I understand that the change will go away once I update the plugin. Hopefully you’ll include a way to change the default search order in an upcoming release.
Thank you.
-S
terjemar,
Lines 28 – 31?
$searchby = isset($_REQUEST['searchby']) ? $_REQUEST['searchby'] : 'title';
$searchbox = isset($_REQUEST['searchbox']) ? $_REQUEST['searchbox'] : '';
$weblib_orderby = isset( $_REQUEST['weblib_orderby'] ) ? $_REQUEST['weblib_orderby'] : 'barcode';
if ( empty( $weblib_orderby ) ) $weblib_orderby = 'barcode';
$weblib_order = isset( $_REQUEST['weblib_order'] ) ? $_REQUEST['weblib_order'] : 'ASC';
if ( empty( $weblib_order ) ) $weblib_order = 'ASC';
to this?
$searchby = isset($_REQUEST['searchby']) ? $_REQUEST['searchby'] : 'title';
$searchbox = isset($_REQUEST['searchbox']) ? $_REQUEST['searchbox'] : '';
$weblib_orderby = isset( $_REQUEST['weblib_orderby'] ) ? $_REQUEST['weblib_orderby'] : 'title';
if ( empty( $weblib_orderby ) ) $weblib_orderby = 'title';
$weblib_order = isset( $_REQUEST['weblib_order'] ) ? $_REQUEST['weblib_order'] : 'ASC';
if ( empty( $weblib_order ) ) $weblib_order = 'ASC';
Lines 102-107
$searchby = isset($_REQUEST['searchby']) ? $_REQUEST['searchby'] : 'title';
$searchbox = isset($_REQUEST['searchbox']) ? $_REQUEST['searchbox'] : '';
$weblib_orderby = isset( $_REQUEST['weblib_orderby'] ) ? $_REQUEST['weblib_orderby'] : 'barcode';
if ( empty( $weblib_orderby ) ) $weblib_orderby = 'barcode';
$weblib_order = isset( $_REQUEST['weblib_order'] ) ? $_REQUEST['weblib_order'] : 'ASC';
if ( empty( $weblib_order ) ) $weblib_order = 'ASC';
Specifically, change lines 104 and 105 to:
$weblib_orderby = isset( $_REQUEST['weblib_orderby'] ) ? $_REQUEST['weblib_orderby'] : 'author, title';
if ( empty( $weblib_orderby ) ) $weblib_orderby = 'author, title';
mysql allows for multiple fields when sorting, so whichever field or fields that you want to sort by need to be specified and delimited by commas.