Image Carousel Thumbnail Slider with SwiperJS and ACF in WordPress

Here is a guide on how to make an image carousel thumbnail slider with SwiperJS and ACF in WordPress. (I have done a similar tutorial with LightersliderJS but that library is no longer updated). Using SwiperJS, I just want to display simple thumbnails below the main image which on click/touch show the image in the…

Read More

Add a CSS class to WooCommerce Shop Page

Woocommerce Add Css Shop Page

Using the filter body_class with the is_shop conditional you can target the main WooCommerce shop page by adding a CSS class. add_filter( ‘body_class’, ‘woo_shop_class’ ); // Add WooCommerce Shop Page CSS Class function woo_shop_class( $classes ) { if ( is_shop() ) // Set conditional $classes[] = ‘woo-shop’; // Add Class return $classes; } The above…

Read More

Removing the Product Meta ‘Categories’ on a Product Page – WooCommerce

woocommerce-remove-product-meta-categories

WooCommerce product categories are displayed at the bottom of a product page just under the add to cart button. You can remove these from the layout by removing the woocommerce_template_single_meta action from the product summary, in your themes functions.php add in … remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40 ); This will remove the categories aka product meta from…

Read More

Sort WooCommerce products in cart order by price

Sort Woocommerce Cart Order By Price

By default the WooCommerce cart is ordered by when products are ordered in sequence, this can be manipulated with the woocommerce_cart_loaded_from_session hook. A new array is created $products_in_cart and the carts content is looped with the key of the array being the price $product->get_price(), the array is then sorted with asort or arsort before being…

Read More

Sort WooCommerce products from product category to be last in cart order

Woocommerce Cart Product Category Last

From a selected WooCommerce product category sort products to be at the end of a carts order. add_action( ‘woocommerce_cart_loaded_from_session’, ‘product_category_cart_items_sorted_end’ ); /** * WooCommerce – sort some Prod Cat items to be last order in cart * @link https://stackoverflow.com/questions/65800801/sort-specific-product-category-cart-items-at-the-end-in-woocommerce */ function product_category_cart_items_sorted_end() { $category_terms = __(‘box’); // Here set your category terms (can be names,…

Read More