Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
If you need to only display search results after a specific date. you can modify the query with pre_get_posts in just one minute using this code snippet.
Steps to display search results after specific date:
function zytheme_display_search_results_after_specific_date( $query ) { if ( $query->is_main_query() && $query->is_search() && ! is_admin() ) { $query->set( 'date_query', array( array( 'after' => 'May 5, 2017', ) ) ); } } add_action( 'pre_get_posts', 'zytheme_display_search_results_after_specific_date' );
Did you find the WordPress snippets in this article helpful? Share it with your friends and if you have any questions and want to ask us about it, please don’t hesitate to add comments.