I am trying to show each variable products stock quantity on the single product page in WooCommerce. I have managed to show all the stock quantities for all the variations using the below code from …
Tag: wordpress
Count of posts within WP Loop not counting posts to use for div class
I’ve successfully been able to count the number of posts within a loop before, but for some reason this time it won’t work. <?php $count = 0; if (have_posts () ) { while (have_posts()) { the_post();…
Second loop on WordPress page not working
Disclaimer: I am trying to help someone with adding another section to their Wordpress site. I did not write most of this code. I am using a different custom post type for each WP_Query loop. Both loops work fine on their own, but when I try to run them on the same page, the second one doesn’t show any posts.
Importing Custom Taxonomy Through CSV into WooCommerce
I have created two custom taxonomies using the CPT UI plugin named Designers (rug_designers) & Product Lines (product_line). I am working on importing products via a CSV into WooCommerce using the built-in WooCommerce importer tool (not the Product CSV Import Suite). I was able to follow this guide to register the Custom Columns in the import with automatic mapping, however,
Save product custom field value as custom order item meta in WooCommerce
I have problem with custom field in woocommerce (latest version). I need your help. My code function completed_order($order_id) { $order = wc_get_order( $order_id ); $customer_id = $order->…
Permission problem: How to setup permissions on docker for windows for use with WordPress
The problem I’m trying to setup my developing environment using Docker for Windows for use with Wordpress. I’m using docker compose with a custom Dockerfile. This works perfectly on MacOS. Using the …
Undefined function wptexturize()
I’m really new to wordpress and I had just encountered this error: I also tried checking on https://developer.wordpress.org/reference/functions/wptexturize/ and I had traced the callers and functions used by this wptexturize() to no avail. The main issue seems to be that the function is undefined. So I checked on the formatting.php file and there it was, clearly defined. My guess is
How to display description on Woocommerce featured products?
I trying to add the the product description to all my related products. This is the code I have from content-single-product.php template file: <?php /** * Hook: …
Get a list of siblings term ids from current product category in WooCommerce
I want to retrieve a list of term Ids based on the current category ID. At the moment I’m using the following code: $product_cat_items = get_queried_object(); $product_cat_id = $product_cat_items-…
Alphabetical filtering of custom post type in WordPress results
I’m working on a custom post type archive and I want to add an A-Z filtering menu. I managed to pretty much get it working following this thread (Create alphabetical Pagination in wordpress) but I …