Created
December 7, 2017 04:28
-
-
Save ajmorris/ce971d94ed957196e5aebcef787a9c1c to your computer and use it in GitHub Desktop.
When no WooCommerce products are found, show your visitor your features products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_no_products_found', 'show_products_on_no_products_found', 20 ); | |
function show_products_on_no_products_found() { | |
echo '<h2>' . __( 'You may be interested in...', 'domain' ) . '</h2>'; | |
echo do_shortcode( '[featured_products per_page="4"]' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment