Deactivating WPML breaks shortcode functionality
-
I installed and tested WPML for about a week. After deactivating it I realized the product_category shortcode wasn’t working as usual anymore. Like on the homepage, only 2 instead of 4 products were visible, but it depended on sorting and the particular category used in the shortcode.
Tuns out I was able to fix it by using the function provided on this site:
https://websavers.ca/woocommerce-shortcodes-not-showing-productsfunction custom_woocommerce_shortcode_products_query( $args ) { if ( 'yes' == get_option( 'woocommerce_hide_out_of_stock_items' ) ) { $args['meta_query'][] = array( 'key' => '_stock_status', 'value' => 'instock', 'compare' => 'IN' ); } return $args; } add_filter( 'woocommerce_shortcode_products_query', 'custom_woocommerce_shortcode_products_query' );
Thing is: why is this needed only after installing and deactivating WPML, never had issues with the shortcodes before. Somethign WPML might have messed up?
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Deactivating WPML breaks shortcode functionality’ is closed to new replies.