WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » Products by Tag shortcode?

Products by Tag shortcode?

Viewing 7 replies - 1 through 7 (of 7 total)
  • List of shortcodes available here . Hope that helps some!

    I totally have to agree with you Jason. I don’t see a way to have a page of items listed by their tag… if there is a way, can someone let us know? If not, can you guys add this to the requests? 🙂

    Thanks folks!

    TT

    You can try query_posts( ‘product_tag=yourTag’ ); .
    According to woocommerce support, it works like wordpress tags 😉

    Here is a better way to do this :

    <?php
    // The Query
    $query = new WP_Query( 'product_tag=-10%' );
    
    echo '<ul>';
    // The Loop
    while( $query->have_posts() ):
    	$query->next_post();
    	echo '<li>';
    	echo '<h3><a href="'. get_permalink( $query->post->ID ) . '">' . get_the_title( $query->post->ID ) . '</a></h3>';
    	echo get_the_post_thumbnail( $query->post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
    	echo '</li>';
    endwhile;
    echo '</ul>';
    // Restore original Query & Post Data
    wp_reset_query();
    wp_reset_postdata();
    ?>

    Hope it helps !

    Thanks I give those a try!

    I’m curious… Did this work for you?

    I’m working on a site that will display different products to different groups of people. I’m planning on using something like Cimy User Extra Fields to assign attributes to users, then use product tags to filter the products to the correct users.

    Here is a quick snippet that works fine: http://www.remicorson.com/list-woocommerce-products-by-tags/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Products by Tag shortcode?’ is closed to new replies.
Skip to toolbar