Bootstrap 4WoocommerceWordpress Tricks

WordPress Query – Show Woocommerce Products in Frontend

Redirect uppercase to lowercase urls in WordPress

Wordpress Query - Show Woocommerce Products in Frontend


Hello to all, welcome to In this post, I will tell you, WordPress Query – Show Woocommerce Products in Frontend.

I am using Bootstrap 4 table for show Woocommerce products data.

With the help of WordPress wp_query, I am getting the Woocommerce Products data. I am showing limited data but we can get products data with our requirement.


Here is the working image:


Wordpress Query - Show Woocommerce Products in Frontend


Here is the working and tested code and you can add this into your any theme’s template file:

<link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>
  <script src=""></script>
  <div class="container">
  <table class="table table-hover">
    <thead class="thead-dark">
        <th>Product Name</th>
        <th>Product Price</th>
        <th>Product Type</th>
        <th>Added By</th>
    $args = array(
        'post_type' => 'product',
        'posts_per_page' => -1
    $loop = new WP_Query( $args );
    if ( $loop->have_posts() ): while ( $loop->have_posts() ): $loop->the_post();
        global $product
        <td><?php echo '<a href="'. get_permalink() .'"><img style="width:40px;height:40px;margin-right:5px;" class="img-responsive" src="' . get_the_post_thumbnail_url() . '">'.get_the_title().'</a>'; ?></td>
        <td><?php echo get_post_meta( get_the_ID(), '_price', true ); ?></td>
        <td><?php echo $product->product_type; ?></td>
        <td><?php echo get_post_meta( get_the_ID(), '_stock_status', true ); ?></td>
        <td><?php $author_id = get_post_field ('post_author', $cause_id);
    $display_name = get_the_author_meta( 'display_name' , $author_id ); 
    echo $display_name; ?></td>

    endwhile; endif; wp_reset_postdata();


Hope this helps, if you have any query related to this post, then do comment below or you can ask question.

Thank you,

Happy Coding,



Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to Myself Ajay Malhotra and I am full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Positive SSL