WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Display a count of total product published (4 posts)

  1. lucamoretto
    Member
    Posted 7 months ago #

    Hi Guys, i need a code in php to display a count total of products in my woocommerce shop. Ty so much in advance.

    http://wordpress.org/plugins/woocommerce/

  2. Roy
    Member
    Posted 7 months ago #

    Not tested...just off the top of my head.

    $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1 );
    
    $products = new WP_Query( $args );
    
    echo $products->found_posts;
  3. lucamoretto
    Member
    Posted 7 months ago #

    WORKS fine!!! ty so much man!!!

  4. lucamoretto
    Member
    Posted 6 months ago #

    Hi SplashingPixels,
    u can help me to solve this problem?

    "i wanna display in the profile of every author (subscriber) a list of all products (woocommerce) uploaded by author with a title + permalink… u can help me in this? TY so much in advance… good day!"

Reply

You must log in to post.

About this Plugin

About this Topic