Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 102165

shnalla on "[Plugin: WooCommerce - excelling eCommerce] Products by Tag shortcode?"

$
0
0

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 !


Viewing all articles
Browse latest Browse all 102165

Trending Articles