//Code to show current categorised recent viewed featured most viewed products add_filter( 'sp_wpspro_arg', 'wpspro_current_categorised_recent_viewed_featured_most_viewed_products', 10, 2 ); function wpspro_current_categorised_recent_viewed_featured_most_viewed_products($arg, $shortcode_id) { if('187' == $shortcode_id || '189' == $shortcode_id || '190' == $shortcode_id ) { $wpspro_current_category_obj = get_queried_object(); if ( isset( $wpspro_current_category_obj->term_id ) ) { $arg['tax_query'][] = array( 'taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => $wpspro_current_category_obj->term_id, 'operator' => 'IN', ); } } return $arg; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter