There’s at least 3 ways to remove the “Sorry, no content matched your criteria text” displayed when no posts exist for your query.
1. Add this line of PHP code in your page template or functions file.
remove_action( 'genesis_loop_else', 'genesis_do_noposts' );
2. If you’re modifying the Infinity Pro child theme by StudioPress which includes a custom loop, you can also remove the no posts text by adding the hook to the existing hooks in the page_team.php template file on line 62 like this :
$hooks = array(
'genesis_loop_else'
);
3. Another way to remove or modify the no posts text is to use the genesis_noposts_text filter hook.
Was This Tutorial Helpful?