mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-23 03:23:42 +03:00
parent
bac15d21fc
commit
11b9bf3604
|
@ -260,6 +260,13 @@ function filter_query( $query ) {
|
||||||
$query->set( 'orderby', 'meta_value_num' );
|
$query->set( 'orderby', 'meta_value_num' );
|
||||||
$query->set( 'order', 'DESC' );
|
$query->set( 'order', 'DESC' );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$query->set( 'orderby', 'rand' );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo remove this when `rand` pagination fixed, see https://github.com/WordPress/five-for-the-future/issues/70#issuecomment-549066883
|
||||||
|
$query->set( 'posts_per_page', 100 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ get_header(); ?>
|
||||||
<label for="pledge-sort"><?php esc_html_e( 'Sort pledges by', 'wordpressorg' ); ?></label>
|
<label for="pledge-sort"><?php esc_html_e( 'Sort pledges by', 'wordpressorg' ); ?></label>
|
||||||
<select class="custom-select" id="pledge-sort" name="order">
|
<select class="custom-select" id="pledge-sort" name="order">
|
||||||
<option value="" <?php selected( $pledge_order, '' ); ?>>
|
<option value="" <?php selected( $pledge_order, '' ); ?>>
|
||||||
<?php esc_html_e( 'All Pledges', 'wordpressorg' ); ?>
|
<?php esc_html_e( 'Random', 'wordpressorg' ); ?>
|
||||||
</option>
|
</option>
|
||||||
<option value="alphabetical" <?php selected( $pledge_order, 'alphabetical' ); ?>>
|
<option value="alphabetical" <?php selected( $pledge_order, 'alphabetical' ); ?>>
|
||||||
<?php esc_html_e( 'Alphabetical', 'wordpressorg' ); ?>
|
<?php esc_html_e( 'Alphabetical', 'wordpressorg' ); ?>
|
||||||
|
|
Loading…
Reference in a new issue