Skip to content

Instantly share code, notes, and snippets.

@fernandoacosta
Forked from SiR-DanieL/functions.php
Last active January 29, 2020 17:04
Show Gist options
  • Save fernandoacosta/c9b6905d32bc2ab94c094032692d98c1 to your computer and use it in GitHub Desktop.
Save fernandoacosta/c9b6905d32bc2ab94c094032692d98c1 to your computer and use it in GitHub Desktop.
Exibir produtos recentes quando nenhum produto for encontrado na busca
add_action( 'woocommerce_no_products_found', 'show_products_on_no_products_found', 20 );
function show_products_on_no_products_found() {
echo '<h2>' . __( 'Mas você pode gostar disso...', 'domain' ) . '</h2>';
echo do_shortcode( '[recent_products per_page="4"]' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment