Created
October 25, 2012 11:18
-
-
Save kloon/3952058 to your computer and use it in GitHub Desktop.
WooCommerce Product Count Shortcode
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
function product_count_shortcode( ) { | |
$count_posts = wp_count_posts( 'product' ); | |
return $count_posts->publish; | |
} | |
add_shortcode( 'product_count', 'product_count_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment