• Why Directorist
    • All Features
    • Solutions
    • Customer Showcase
    • Testimonials
  • Extensions
  • Themes
  • App
  • Resources
    • Documentations
    • Support Center
    • Contact Us
    • Roadmap
    • Beta
    • About Us
    • Team
  • Pricing
  • Blog
Sing In

 
[add_to_cart]

[directorist_all_listing redirect_page_url="www.aazztech.com"]
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby' );

function woocommerce_shortcode_products_orderby( $args ) {

    $standard_array = array('menu_order','title','date','rand','id');

    if( isset( $args['orderby'] ) && !in_array( $args['orderby'], $standard_array ) ) {
        $args['meta_key'] = $args['orderby'];
        $args['orderby']  = 'meta_value_num'; 
    }

    return $args;
}
Note: the ‘limit’ shortcode argument will determine how many products are shown on a page. This will not add pagination to the shortcode.

 
 

© 2025 All rights reserved