diff --git a/wp-content/plugins/core/src/Blocks/Blocks_Definer.php b/wp-content/plugins/core/src/Blocks/Blocks_Definer.php index 0b4783d8..113e9f55 100644 --- a/wp-content/plugins/core/src/Blocks/Blocks_Definer.php +++ b/wp-content/plugins/core/src/Blocks/Blocks_Definer.php @@ -14,6 +14,7 @@ use Tribe\Theme\blocks\core\postterms\Post_Terms; use Tribe\Theme\blocks\core\querypagination\Query_Pagination; use Tribe\Theme\blocks\core\quote\Quote; +use Tribe\Theme\blocks\core\search\Search; use Tribe\Theme\blocks\core\separator\Separator; use Tribe\Theme\blocks\core\spacer\Spacer; use Tribe\Theme\blocks\core\table\Table; @@ -45,6 +46,7 @@ public function define(): array { DI\get( Post_Terms::class ), DI\get( Query_Pagination::class ), DI\get( Quote::class ), + DI\get( Search::class ), DI\get( Separator::class ), DI\get( Spacer::class ), DI\get( Table::class ), diff --git a/wp-content/themes/core/blocks/core/search/Search.php b/wp-content/themes/core/blocks/core/search/Search.php new file mode 100644 index 00000000..2eb1af27 --- /dev/null +++ b/wp-content/themes/core/blocks/core/search/Search.php @@ -0,0 +1,17 @@ +post_count; +$count = (int) $wp_query->found_posts; $output = sprintf( _n( '%d result', '%d results', $count, 'tribe' ), number_format_i18n( $count ) ); if ( $is_search ) { diff --git a/wp-content/themes/core/blocks/tribe/query-results-count/style.pcss b/wp-content/themes/core/blocks/tribe/query-results-count/style.pcss index 112b33dd..a145786b 100644 --- a/wp-content/themes/core/blocks/tribe/query-results-count/style.pcss +++ b/wp-content/themes/core/blocks/tribe/query-results-count/style.pcss @@ -12,4 +12,12 @@ .search-term { font-weight: 700; } + + /** + * hide block if there are no search results + * only applies to search results template. + */ + .search-no-results & { + display: none; + } } diff --git a/wp-content/themes/core/parts/pagination.html b/wp-content/themes/core/parts/pagination.html deleted file mode 100644 index 07d7da69..00000000 --- a/wp-content/themes/core/parts/pagination.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/wp-content/themes/core/templates/search.html b/wp-content/themes/core/templates/search.html index 80f3f2dd..698bc01e 100644 --- a/wp-content/themes/core/templates/search.html +++ b/wp-content/themes/core/templates/search.html @@ -28,12 +28,8 @@

Search - -

No results found

- - - -

Sorry, but nothing matched your search terms. Please try again with some different keywords.

+ +

Your search query returned no results. Try another search term.

@@ -41,7 +37,11 @@

No results found

- + + + + +