When a search or category has no results, GeoDirectory shows “No listings were found matching your selection. Something missing? Why not add a listing?”. The second sentence only appears when visitors are allowed to add listings from the front end. You can drop it in three ways.
Turn off front end adding
If you do not let visitors submit listings, this is the cleanest fix. GeoDirectory then shows only “No listings were found matching your selection.”
- Go to Places > Settings > General.
- Show the advanced settings with the toggle at the top of the page.
- Tick Disable frontend add and save.
- Repeat for every other post type you have. The message links to any post type that still allows adding, so all of them need the setting.
Change the message with a snippet
This keeps front end adding on and replaces the whole message. Add it with the Code Snippets plugin or your child theme’s functions.php:
add_filter( 'geodir_no_listings_found_message', 'my_gd_no_listings_message', 10, 2 );
function my_gd_no_listings_message( $message, $post_type ) {
return __( 'No listings were found matching your selection.', 'geodirectory' );
}
Translate the string
The text is one translatable string, so you can also replace it with a translation tool such as Loco Translate or Poedit. Search for the full string, which contains a link placeholder, and translate it to just the first sentence. How to change just one language string walks through it.
Hiding it with CSS is possible but the whole notice shares one element, so .geodir-info hides the “No listings were found” part as well.