diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php index c519a585..77bd9d27 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php @@ -180,6 +180,11 @@ function get_sort_options( $options ) { $sort = 'favorite_count_desc'; } + // Show the correct filters on the front page. + if ( is_front_page() ) { + $sort = 'date_desc'; + } + $label = __( 'Sort', 'wporg-patterns' ); switch ( $sort ) { case 'date_desc': @@ -193,12 +198,6 @@ function get_sort_options( $options ) { break; } - // Show the correct filters on the front page. - if ( is_front_page() ) { - $sort = 'favorite_count_desc'; - $label = __( 'Popular', 'wporg-patterns' ); - } - $options = array( 'date_desc' => __( 'Newest', 'wporg-patterns' ), 'date_asc' => __( 'Oldest', 'wporg-patterns' ), @@ -256,7 +255,7 @@ function inject_other_filters( $key ) { printf( '' ); } if ( 'orderby' !== $key ) { - printf( '' ); + printf( '' ); } } diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php index 5ef3dfcc..3b58b2a7 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/patterns/_grid-front-page.php @@ -7,7 +7,7 @@ */ ?> - +