How to filter all products by products_tag (woocommerce )
I found the answer, it was a typing mistake, you have to put ‘product_tag’ => ‘wherever_tag_you_use’ and it’s works like charm
I found the answer, it was a typing mistake, you have to put ‘product_tag’ => ‘wherever_tag_you_use’ and it’s works like charm
Instead of editing the template you could also try this: <?php /** Remove short description if product tabs are not displayed */ function dot_reorder_product_page() { if ( get_option(‘woocommerce_product_tabs’) == false ) { remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 ); } } add_action( ‘woocommerce_before_main_content’, ‘dot_reorder_product_page’ ); /** Display product description the_content */ function dot_do_product_desc() { global $woocommerce, $post; … Read more
D’oh. I fixed it, but I’ll leave this question in case others have similar problems. When copy/pasting various options into wp-config.php I accidentally included this setting, which I don’t normally use: // Overkill but FYI: disallows installation/updating of any theme or plugin define(‘DISALLOW_FILE_MODS’,true); That produces the described problem, albeit by design.
Hook the wp_footer action to output markup before </body>: function your_function() { echo ‘<p>foo</p>’; } add_action(‘wp_footer’, ‘your_function’);
I will approach like this: global $current_user; get_currentuserinfo(); $email = (string) $current_user->user_email; var_dump($email); You just called got the email from the current_user array and cast it into string 🙂 that’s it
To create a taxonomy term programmatically you can use wp_insert_term function. <?php wp_insert_term( $term, $taxonomy, $args = array() ); ?> It has 3 params: $term (int|string) (required) The term to add or update. Default: None $taxonomy (string) (required) The taxonomy to which to add the term. Default: None $args (array|string) (optional) Change the values of … Read more
In WooCommerce checkboxes have always a value of ‘1’. So you do not need to pass ‘value’ => true: it does nothing. To set checkbox checked or not WooCommerce uses the WP checked function where 1 (integer) is compared with the value you pass as third param in woocommerce_form_field. Pass 1 as default and your … Read more
As you said per page/post basis, this would work for each post add_action(‘wp_head’, ‘add_link_in_head’); function add_link_in_head() { global $post; if(!empty($post)) { $alternate = get_post_meta($post->ID, ‘alternate’, true); $hreflang = get_post_meta($post->ID, ‘hreflang’, true); if(!empty($alternate) && !empty($hreflang)) { ?> <link rel=”alternate” href=”https://wordpress.stackexchange.com/questions/110260/<?php echo $alternate; ?>” hreflang=”<?php echo $hreflang; ?>” /> <?php } } } If there is no … Read more
You could install the Post Type Switcher plugin Or Run SQL query on your database to change the post to product post type UPDATE `wp_posts` SET `post_type` = ‘product’ WHERE `post_type` = ‘post’; Backup your DB 1st. UPDATE `wp_posts` SET `post_type` = ‘wpsc-product’ WHERE `post_type` = ‘post’;
One of your old favourite songs from way back when For the fun of it, straight from the plugin page. This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see … Read more