With the following code I managed to display my featured categories title, description and thumbnail. When I uploaded the thumbnail, it was 500 * 500 in its dimensions. But when I visit the page I see the thumbnail being cropped as 150 * 150. How can I change the size of my categorythumbnails? It is my first …
Tag: wordpress
How to get just the term_ids from get_the_terms in WordPress
I am building a wordpress website that uses a custom AJAX filter that is linked to my Custom categories. This is my function ajax-filter.php: My question is: How can i use my data from tax to term-id in the way that i use in my ajax-filter.php? to use my data ($value->title) Answer Firstly, well done on cr…
Replace WooCommerce attribute labels by a custom image for each
I am working on project and I need some group help. I am using woocommerce product system and on shop archive page product I am showing attribute-label: attribute-value (just like text). attribute-…
Set variations default attributes values for a variable product Programmatically
I’m building a site where WooCommerce Variable products (with Products Variations) are inserted programmatically. I have followed this tutorial successfully: Insert WooCommerce Products & Variations Programmatically I need just something that is missing: How to set variations default attributes valu…
Set WooCommerce order status when order is created from processing to pending
When a woocommerce order is created the status of the order is “processing”. I need to change the default order-status to “pending”. How can I achieve this? Answer The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked func…
WordPress and best practice with passive event listeners
So I have run an audit on a website in chrome and google says I should use passive event listeners. I have looked through the code and identified it’s coming from the wordpress emoji integration: &…
Show SKU on cart and checkout pages in Woocommerce 3
I would like to display SKU on cart (Under product column ) and checkout page. I searched SO, but all answers are for old versions of WooCommerce and non of them is for 3.x. How can I show SKU on cart and checkout pages in Woocommerce 3? Answer 2021 Update You can do it with a custom unction hooked in
Nested shortcode to dynamically display WooCommerce products category
I am attempting to display a WooCommerce product category page based on the current user role. I have created a custom function get_user_role() to get the user role and added the shortcode [user_role]…
Displaying full product description on product lightbox
Is there a WooCommerce add_action to display the full product description, this is the text found in the main text edit window (not the Product short description) After a quick google search I was …
Unset product tabs for specific product categories in woocommerce
I am using the code coming from this answer: Hiding tabs only for some products in WooCommerce single product pages Here is that code: This code works fine to unset or hide tabs from specific products. Instead I would like to unset or hide tabs from specific product categories. How can I do it for product cat…