Title: mirwordpress's Replies - page 2 | WordPress.org

---

# mirwordpress

  [  ](https://wordpress.org/support/users/mirwordpress/)

 *   [Profile](https://wordpress.org/support/users/mirwordpress/)
 *   [Topics Started](https://wordpress.org/support/users/mirwordpress/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mirwordpress/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mirwordpress/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mirwordpress/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mirwordpress/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mirwordpress/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 16 through 30 (of 33 total)

[←](https://wordpress.org/support/users/mirwordpress/replies/?output_format=md) 
[1](https://wordpress.org/support/users/mirwordpress/replies/?output_format=md) 
2 [3](https://wordpress.org/support/users/mirwordpress/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/mirwordpress/replies/page/3/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] query strings in wordpress and woocommerce](https://wordpress.org/support/topic/query-strings-in-wordpress-and-woocommerce/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/query-strings-in-wordpress-and-woocommerce/#post-14736968)
 * Hi [@gabrielfuentes](https://wordpress.org/support/users/gabrielfuentes/), thank
   you so much for your response. I actually managed to accomplish it yesterday 
   by appending:
 * `'?product_tag=' . urlencode($atts["tag"])`
 * to the output string. I think I was overcomplicating a simple task – or Woocommerce
   already had the query string in place for product tags, i just needed to write
   it correctly.
 * thanks again 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [alter url based on tag](https://wordpress.org/support/topic/alter-url-based-on-tag/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/alter-url-based-on-tag/#post-14729878)
 * hi [@lepittenger](https://wordpress.org/support/users/lepittenger/) & thank you
   for your reply.
 * I didn’t write my question properly; to be exact, what i want is for when a customer
   clicks on the a category, depending on the page they are currently on ( there
   will be a parent category here ) only some products in that category are tagged
   for that category. so when they click that category ( while on a particular parent
   cat page ) I want only those tagged products to appear ( for that category ).
 * i hope i explained that ok – see i have a custom function for those parent cat
   pages that only show categories that have products with those specific tagged
   products – im not sure whether i need to amend that function further for what
   i want now, or if i need to amend the function AND create custom taxonomy pages.
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [mysql query for category and tag intersection ( for a shortcode func )](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/#post-14714235)
 * hi and thank you for your reply.
 * I have had to work on other projects and returned to this yesterday. I have tried
   another way and succeeded but not sure if my code is correct. I have used echo
   within the function as i couldn’t figure out any way to have the url to appear.
   I know echo should not be used within a shortcode function.
 * would you have any advice for my code attempt?
    i also need to change this so
   that ‘testingtag’ can be added within the shortcode parameters.
 *     ```
       function display_products()
       {
        ob_start();
   
        $args = array( 
                   'post_type'      => 'product', 
                   'posts_per_page' => -1, 
                   'product_tag'    => array('testingtag'),
                   );
        $loop = new WP_Query( $args );
        $product_count = $loop->post_count;
   
   
   
        if( $product_count > 0 ){
           ?><div class="woocommerce columns-4"><ul class="products columns-4"> <?php
           while ( $loop->have_posts() ) : $loop->the_post(); 
                   global $product;
                   global $post;
   
                   $loop->post->ID;
   
                   $product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' );   
   
   
                   $post_slug = $post->post_name;
   
                   foreach( $product_cats as $collection ) {   
                       $test = ''; 
                       $single_cat = '';         
                       $test .= $collection->slug;
                       if ( $product_cats && ! is_wp_error ( $product_cats ) ){
                           $single_cat = array_shift( $product_cats );  ?>
   
                           <li class="product-category product brand_cats"><div class="banner-box"><div class="banner-box__image"> <a href="<? bloginfo( 'url' ); ?>/product-category/<? $test; ?>/">
                           <?php glana_woo_subcategory_thumbnail( $collection);  ?>           
   
                       </a></div>
                           <div class="banner-box__info"><a href="<?php bloginfo( 'url' ); ?>/product-category/<?php $test; ?>/"><h2 itemprop="name" class="woocommerce-loop-category__title"><span><?php $single_cat->name; ?></a></span></h2></li><?php }  
                        }           
           endwhile;
           ?></ul></div> <?php
        }else{
              ?><p>No product matching your criteria.</p><?php
        }
   
        $result =  ob_get_clean();
        return $result;
        }
        add_shortcode('display_products_by_tag', 'display_products');
       ```
   
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Knowledge Base] can i use this plugin to display product categories based on a specific tag?](https://wordpress.org/support/topic/can-i-use-this-plugin-to-display-product-categories-based-on-a-specific-tag/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/can-i-use-this-plugin-to-display-product-categories-based-on-a-specific-tag/#post-14675366)
 * thank you for your response.
 * do you think i could achieve my goal somehow or have you any tips on how i could
   achieve it?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [mysql query for category and tag intersection ( for a shortcode func )](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/#post-14675338)
 * hi and thank you for your response. What i am trying to do is as follows: ( I
   think I may soon give up it seems impossible! )
 * the website will cater for many different workplaces / industries but they will
   have the same categories in some cases, like ‘Hygiene’, ‘Workwear’. so for example,
   if a customer clicks on the workplace of Nursing Homes, the categories will show
   but when the category is clicked, like say they click ‘hygiene’; it will show
   the customer further categories and products for Hygiene that have products with
   the tag ‘nursing homes’. But the products will have many tags, like say ‘nursing
   homes’, ‘construction’, ‘kennels’ etc. So i want to show the customer relevant
   products for that workplace, and not show them something related like to construction
   hygiene, for example.
 * I hope this explains it better but i think maybe i am trying to do something 
   that has not been done before – or is impossible.
 * pls let me know your thoughts.
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [mysql query for category and tag intersection ( for a shortcode func )](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/#post-14656285)
 * hi tried order by, its not working. I think it’s some simple tweak that I can’t
   work out. this is probably something very complex. if you know of a way of achieving
   it through the wp_query class pls let me know. I am currently looking into this.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [mysql query for category and tag intersection ( for a shortcode func )](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/#post-14655570)
 *     ```
       SELECT wp_terms.* 
           FROM wp_terms 
          INNER JOIN wp_term_taxonomy ON wp_terms.term_id = wp_term_taxonomy.term_id
                INNER JOIN wp_term_taxonomy AS ctax ON wp_terms.term_id = ctax.term_id
                INNER JOIN wp_term_relationships AS crel ON crel.term_taxonomy_id = ctax.term_taxonomy_id
       INNER JOIN wp_posts AS posts ON posts.ID = crel.object_id
       INNER JOIN wp_term_relationships AS trel ON posts.ID = trel.object_id
       INNER JOIN wp_term_taxonomy AS ttax ON trel.term_taxonomy_id = ttax.term_taxonomy_id
       INNER JOIN wp_terms AS tags ON ttax.term_id = tags.term_id
                WHERE ctax.taxonomy = 'product_cat'
       AND ttax.taxonomy = 'product_tag'
       AND posts.post_type = 'product'
       AND posts.post_status = 'publish'
       AND tags.term_id = '%d'
       GROUP BY wp_terms.term_id = 247
       ```
   
 * this is my current query – it’s not working as i expectded.
    -  This reply was modified 5 years ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [mysql query for category and tag intersection ( for a shortcode func )](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/mysql-query-for-category-and-tag-intersection-for-a-shortcode-func/#post-14654563)
 * thank you. My thinking was to try get the sql query working in php myadmin first
   and then compose it into the format required for the php function.
 * i can’t seem to get the query to work.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [shortcode to display categories that have products with a specific tag only](https://wordpress.org/support/topic/shortcode-to-display-categories-that-have-products-specific-tag-only/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years ago](https://wordpress.org/support/topic/shortcode-to-display-categories-that-have-products-specific-tag-only/#post-14652057)
 * thank you Joy. My question was a little muddled. I have re posted the question
   with my further attempts.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Carousels with Owl] product image slider and owl carousel](https://wordpress.org/support/topic/product-image-slider-and-owl-carousel/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/product-image-slider-and-owl-carousel/#post-14264893)
 * yes i get what you mean. i really would like it to work, it seems to simple but
   yet seems difficult to implement. could you advise on which hooks i could use,
   or if if you believe its not possible. thank you again
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Carousels with Owl] product image slider and owl carousel](https://wordpress.org/support/topic/product-image-slider-and-owl-carousel/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/product-image-slider-and-owl-carousel/#post-14264696)
 * hi
    thank you for your reply. so if a product has alot of variations ( which 
   means many thumbnails at the bottom of the main product image ) i want it to 
   be like a slider with arrows ( for the thumbnails ) for now i have hidden the
   images after the 4th image using css nth child, but would prefer to have it as
   a slider/carousel.
 * the website uses Elementor pro, and the single product page uses an elementor
   widget called product images to display product images.
    any help at all would
   be great – i have been hours trying to find a solution – even tried to implement
   javascript /jquery but im not too familar with js
    -  This reply was modified 5 years, 4 months ago by [mirwordpress](https://wordpress.org/support/users/mirwordpress/).
 *   Forum: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
   
   In reply to: [Can i use Bootstrap with WordPress](https://wordpress.org/support/topic/can-i-use-bootstrap-with-wordpress/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/can-i-use-bootstrap-with-wordpress/#post-14119355)
 * Thank you.
    Are there any alternatives? I am using as a Elementor pro. My job
   purchased a theme but I may drop it eventually
 *   Forum: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
   
   In reply to: [Can i use Bootstrap with WordPress](https://wordpress.org/support/topic/can-i-use-bootstrap-with-wordpress/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/can-i-use-bootstrap-with-wordpress/#post-14118608)
 * Thanks Joy.
 * Do you mean loading the bootstrap library may affect performance?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Bulk product upload for a small business](https://wordpress.org/support/topic/bulk-product-upload-for-a-small-business/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/bulk-product-upload-for-a-small-business/#post-13242247)
 * thanks for that link will check it out 🙂
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Bulk product upload for a small business](https://wordpress.org/support/topic/bulk-product-upload-for-a-small-business/)
 *  Thread Starter [mirwordpress](https://wordpress.org/support/users/mirwordpress/)
 * (@mirwordpress)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/bulk-product-upload-for-a-small-business/#post-13242239)
 * thank you again.
    I was hoping to upload current versions of products as the 
   current website is outdated and alot of products and their imagery are outdated.
   it would be interesting to know what experienced developers do in this case –
   where they have 1000s of products to upload. I did come across WP-CLI – have 
   you ever used this or heard much about it?
 * Otherwise, no other leads than to use the default woocommerce upload function..

Viewing 15 replies - 16 through 30 (of 33 total)

[←](https://wordpress.org/support/users/mirwordpress/replies/?output_format=md) 
[1](https://wordpress.org/support/users/mirwordpress/replies/?output_format=md) 
2 [3](https://wordpress.org/support/users/mirwordpress/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/mirwordpress/replies/page/3/?output_format=md)