<section class="page-section">
<div class="container">
<div class="sec_con_pro">
<div class="row">
<?php
$taxonomyName = "product_cat";
$prod_categories = get_terms($taxonomyName, array(
'orderby'=> 'name',
'order' => 'ASC',
'hide_empty' => 1,
));
foreach( $prod_categories as $prod_cat ) :
if ( $prod_cat->parent != 0 )
continue;
$cat_thumb_id = get_woocommerce_term_meta( $prod_cat->term_id, 'thumbnail_id', true );
$cat_thumb_url = wp_get_attachment_thumb_url( $cat_thumb_id );
$term_link = get_term_link( $prod_cat, 'product_cat' );
?>
<div class="col-md-2 col-xs-3 cat_container">
<div class="thumbnail no-border no-padding thumbnail-banner size-1x3">
<div class="media">
<div id="media_image-5" class="widget widget_media_image"><a href="<?php echo $term_link; ?>"><img src="<?php echo $cat_thumb_url; ?>" alt="" /></a></div>
</div>
</div>
<h4 class="caption-title cat_home_title"><a class="button" href="<?php echo $term_link; ?>"> <?php echo $prod_cat->name; ?> </a></h4>
</div>
<?php endforeach;
wp_reset_query();
?>
</div>
</div>
</div>
</section>
woocommerce offtopic - how i can limit woo Category number like as 'posts_per_page' => -1, but it cannot
与本文相关的文章
- Template definition in .h file requires me to include .h files, C++ - Stack Overflow
- javascript - How to resize iframe on window resize - Stack Overflow
- javascript - Add spell check to my website - Stack Overflow
- javascript - strange error when including no-cors into header for fetch of json content in a react.js - Stack Overflow
- javascript - How to make a div animate in on page load? - Stack Overflow
- javascript - reset slider to initial values - Stack Overflow
- javascript - issues executeScript permission - Stack Overflow
- custom post types - Help understand and create a loop with WP_query
- nfc - write secured NTAG215 with pn532 on arduino - Stack Overflow
- javascript - jQuery won't find custom tags - Stack Overflow
- javascript - Infinitely nested ng-repeat in an Angular directive - Stack Overflow
- javascript - Get Element that Parent not a class - Stack Overflow
- javascript - How can I pass in generic HTML to an Angular 2 component? - Stack Overflow
- javascript - How to add query param in Cypress (JS) - Stack Overflow
- javascript - In IOS hide input field blinking cursor for CSS - Stack Overflow
- javascript - Getting avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
- prometheus - Grafana Query to see which instance contains highest CPU usage - Stack Overflow
- python - Selenium element raise StaleElementReferenceException even with explicit wait - Stack Overflow
- categories - Cannot use object of type WP_Error as array display category
- javascript - react - declare global variable inside of a react component - Stack Overflow
评论列表(0)
- 暂无评论