php woocommerce流行品牌旋转木马与光滑和自定义分类循环

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php woocommerce流行品牌旋转木马与光滑和自定义分类循环相关的知识,希望对你有一定的参考价值。

<section class="popular-brands">
	<div class="container">
		<div class="row text-center">
			<div class="col-md-10 col-md-offset-1">
			<h1 class="sectionheading script">Brands We Carry</h1>
			<p>Browse our selection of high quality products from some of the top brands in the industry. </p>
			</div>
		</div>
		<div class="row padsides text-center">
			<?php 
			// get all the brands with link
			$brands = get_terms(array(
				'taxonomy' => 'product_brand',
				'hide_empty' => false,
				'order' => 'DESC',
				'orderby' => 'count',
				'number' => 12,
				)); 
			echo '<div class="brand-carousel">';
			foreach ($brands as $brand) { ;?>
			<?php 
			$thumbnail = get_brand_thumbnail_url( $brand->term_id, apply_filters( 'woocommerce_brand_thumbnail_size', 'brand-thumb' ) );
			if ( ! $thumbnail )
				$thumbnail = wc_placeholder_img_src(); 
			?>
			<div class="col-md-3">
				<a href="<?php echo get_term_link( $brand->slug, 'product_brand' ); ?>" title="<?php echo $brand->name; ?>" class="term-thumbnail">
					<img src="<?php echo $thumbnail; ?>" alt="<?php echo $brand->name; ?>" />
					<h3><?php //echo $brand->name; ?></h3>
				</a>
				<div id="term-<?php echo $brand->term_id; ?>" class="term-description">
					<?php echo wpautop( wptexturize( $brand->description ) ); ?>
				</div>
			</div>
			<?php }
			echo '</div>';
			?>
		</div>
	</div>
</section>

以上是关于php woocommerce流行品牌旋转木马与光滑和自定义分类循环的主要内容,如果未能解决你的问题,请参考以下文章

php [WooCommerce Brands]改变品牌档案的永久链接

php [WooCommerce Brands]在管理面板上展示了前端的品牌

php 产品旋转木马 - 隐藏的移动视图

php 猫头鹰旋转木马

php [WooCommerce 360​​ Image]旋转-90度

php [WooCommerce 360​​ Image]自定义旋转