Title: Woocommerce specific loop
Last modified: December 10, 2019

---

# Woocommerce specific loop

 *  Resolved [kword](https://wordpress.org/support/users/kw56/)
 * (@kw56)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-specific-loop/)
 * Hello,
 * I use OceanWP child theme and WOOF filter plugin.
    I want to show only featured
   products on specific category pages when the url is `mysite/category`. But there
   must be shown all the products (not only featured) after submitting the filter
   button and the url became `mysite/category/?swoof=...`
 * I think about some custom query like
 *     ```
           $q = new WP_Query([
             'post_type'   =>  'product',
             'meta_query'  =>  [ 
               ['key' => '_featured', 'value' => 'yes' ]
               ]
           ]);
           if ( $q->have_posts() ) :
               while ( $q->have_posts() ) : $q->the_post();
                   // display 
               endwhile; wp_reset_query();
           endif;
       ```
   
 * But don’t know how to add the condition to the main loop in categories. Can you
   please help me? Thank you in advance
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwoocommerce-specific-loop%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-specific-loop/#post-12230371)
 * This is a fairly complex development topic. I’m going to leave it open for a 
   bit to see if anyone is able to chime in to help you out.
 * I can also recommend the following places for more development-oriented questions:
    1. WooCommerce Slack Community: [https://woocommerce.com/community-slack/](https://woocommerce.com/community-slack/)
    2. Advanced WooCommerce group on Facebook: [https://www.facebook.com/groups/advanced.woocommerce/](https://www.facebook.com/groups/advanced.woocommerce/)
 *  Thread Starter [kword](https://wordpress.org/support/users/kw56/)
 * (@kw56)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/woocommerce-specific-loop/#post-12247925)
 * I’ve done it by myself. I display featured products on page via woocommerce shortcode,
   then use redirect to category via WOOF filter shortcode.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Woocommerce specific loop’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [kword](https://wordpress.org/support/users/kw56/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/woocommerce-specific-loop/#post-12247925)
 * Status: resolved