title: How to add woocommerce-pagination and woocommerce-ordering dropdown to custom shortcode
body: <p>I've created a custom shortcode to display products with a minimum stock amount and would like to add pagination to the results as well as calling the woocommerce-ordering dropdown to be displayed on the page.</p>
  
  <p>Here's the shortcode:</p>
  
  <pre><code>// Minimum Stock Shortcode
  add_shortcode( 'minimum_stock', 'minimum_stock_shortcode' );
  
  function minimum_stock_shortcode( $atts ) {
  
  global $woocommerce_loop;
  
  // Attributes 
          $atts = shortcode_atts(
              array(
              'limit'         =&gt; '40',
              'columns'       =&gt; '5',
              'orderby'       =&gt; 'title',
              'order'         =&gt; 'asc',
              'category'      =&gt; '',
              'cat_operator'  =&gt; 'IN',
              'stock' =&gt; '',
              ),
              $atts, 'minimum_stock'
          );
  
          $args = array(
              'post_type'             =&gt; 'product',
              'post_status'           =&gt; 'publish',
              'ignore_sticky_posts'   =&gt; 1,
              'posts_per_page'        =&gt; $atts['limit'],
              'orderby'               =&gt; $atts['orderby'],
              'order'                 =&gt; $atts['order'],
              'meta_query'            =&gt; array(
                  array(
                      'key'           =&gt; '_stock',
                      'value'         =&gt; $atts['stock'],
                      'compare'       =&gt; '&gt;='
                  )
              ),
              'tax_query'             =&gt; array(
                  array(
                      'taxonomy'      =&gt; 'product_cat',
                      'field'         =&gt; 'slug',
                      'terms'         =&gt; $atts['category'],
                  )   
              )
          );
  
  
  ob_start();
  
  $products = new WP_Query( $args );
  
  $woocommerce_loop['columns'] = $atts['columns'];
  
  if ( $products-&gt;have_posts() ) : ?&gt;     
  
      &lt;?php woocommerce_product_loop_start(); ?&gt;
  
          &lt;?php while ( $products-&gt;have_posts() ) : $products-&gt;the_post(); ?&gt;
  
              &lt;?php woocommerce_get_template_part( 'content', 'product' ); ?&gt;
  
          &lt;?php endwhile; // end of the loop. ?&gt;
  
      &lt;?php woocommerce_product_loop_end(); ?&gt;
  
  &lt;?php endif;
  
  wp_reset_postdata();
  
  return '&lt;div class="woocommerce"&gt;' . ob_get_clean() . '&lt;/div&gt;';
  }
  </code></pre>
  
  <p>Any help would be very much appreciated!</p>
  
  <p>Kind regards,
  JP</p>