Snippets: Front-End “No Posts Found” Notice for Total Modules

The Total theme by default won't display anything when there aren't any posts related to a Query while using modules such as the Post Types Grid, Post Types Carousel, Blog Grid, Blog Carousel, Portfolio Grid, Portfolio Carousel...etc. However, there is a filter available if you wanted to display a notice on the front end. This filter passes on on the module settings ($atts variable) so you can check the module settings to display different messages depending on the module.

add_filter( 'vcex_no_posts_found_message', function( $atts ) {
	// print_r( $atts ); // you can uncomment this to view the current module settings
	return 'Your custom no posts found message or HTML here.';
} );
All PHP snippets should be added via a child theme's functions.php file.