Woocommerce: order posts by meta key
meta_query should be an array of arrays like: … ‘meta_query’ => [ [ ‘key’ => ‘…’, ‘value’ => ‘…’, ], ], …
meta_query should be an array of arrays like: … ‘meta_query’ => [ [ ‘key’ => ‘…’, ‘value’ => ‘…’, ], ], …
You should use isset(): if ( isset( $item_data[‘name’] ) ) { // your code }
You would probably need to do this with jQuery by detecting the hash value and activating the class based on that. Something like this might work: add_action(‘wp_footer’, ‘custom_review_form_activate’); function custom_review_form_activate() { echo “<script>if (window.location.hash == ‘review_form’) { jQuery(‘.reviews_tab’).addClass(‘active’); }</script>”; } (Of course if your theme or customizations already have some jquery you can add it … Read more
I would strongly disagree to show the password as the user typing it. You could instead implement a way to show the status of the field with a user action like a user click to show password or on hover. The reason is that the user makes the decision to show the password. Also, improve … Read more
get_category_link only works on built-in WP Categories. It does not work on WooCommerce Product Categories. Use get_term_link instead. <a href=”https://wordpress.stackexchange.com/questions/281155/<?php echo get_term_link( $category_id,”product_cat’) ?>”> <?php echo $title; ?> </a>
Solved using this code: if ($product->is_type( ‘variable’ )){ // Get the available variations for the variable product $available_variations = $product->get_available_variations(); // Initializing variables $variations_count = count($available_variations); $loop_count = 0; // Iterating through each available product variation foreach( $available_variations as $key => $values ) { $loop_count++; // Get the term color name $attribute_color = $values[‘attributes’][‘attribute_pa_size’]; $wp_term … Read more
The plugin you posted creates a new widget with 2 input fields. One field for the title of the widget, another field to enter a comma separated list of product ID´s. You can change the provided code, to be able to enter a comma separated list of product_cat ID´s. (instead of product ID´s) You only … Read more
I think get_the_tag_list is only used for the default WordPress tags. WooCommerce product tags are a custom taxonomy called product_tag. Therefore you cannot use this function to return these tags. (anyone please correct me if I am wrong here) Instead you could use the WordPress get_the_terms() function, to get a “similar” result. Bare bones: // … Read more
Set it up using a subdomain/whatever is needed to get it working, then go to network admin and edit the site, and change its URL to the desired domain. If you want more complex setups though, what you’re trying to do is called domain mapping, and there are plugins from before WP Core supported this … Read more
Try something like this in your functions.php: function ran_remove_parent_category_from_url( $args ) { $args[‘rewrite’][‘hierarchical’] = false; return $args; } add_filter( ‘woocommerce_taxonomy_args_product_cat’, ‘ran_remove_parent_category_from_url’ );