Woocommerce product category listing

  • 0

<?php
$args = array(
‘number’ => ‘6’,
‘orderby’ => ‘title’,
‘order’ => ‘ASC’
);
$product_categories = get_terms( ‘product_cat’, $args );
foreach ( $product_categories as $product_category ) {
$thumbnail_id = get_woocommerce_term_meta( $product_category->term_id, ‘thumbnail_id’, true );
$image = wp_get_attachment_url( $thumbnail_id );
echo “<img src='{$image}’ alt=” width=’762′ height=’365′ />”;
echo ‘<h4><a href=”‘ . get_term_link( $product_category ) . ‘”>’ . $product_category->name . ‘</a></h4>’;

}
?>

<?php $args = array( ‘number’ => ‘6’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ ); $product_categories = get_terms( ‘product_cat’, $args ); foreach ( $product_categories as $product_category ) { $thumbnail_id = get_woocommerce_term_meta( $product_category->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); echo “<img src='{$image}’ alt=” width=’762′ height=’365′ />”; echo ‘<h4><a href=”‘ . get_term_link( $product_category ) . ‘”>’…

<?php $args = array( ‘number’ => ‘6’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ ); $product_categories = get_terms( ‘product_cat’, $args ); foreach ( $product_categories as $product_category ) { $thumbnail_id = get_woocommerce_term_meta( $product_category->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); echo “<img src='{$image}’ alt=” width=’762′ height=’365′ />”; echo ‘<h4><a href=”‘ . get_term_link( $product_category ) . ‘”>’…

Leave a Reply

Your email address will not be published. Required fields are marked *