我需要像这样动态调用<li>
类:
<li <?php post_class( $classes ); echo $filters; ?> data-expand="-100">
我的结构是:
echo '<li> <h3>' . $term->name . '</h3>';
如何在我的结构中实现上述结构?
我需要在函数<li>
中动态填充post_class($classes)
类,并使用过滤器和数据展开。
我正在寻求的帮助是如何编写'echo',以便它显示像li元素和data-expand这样的静态元素,同时执行像函数post_class($classes)
和变量这样的动态元素'$ filters'和'$ term-&gt; name'并给我这样的输出
<li class=" col-xs-12 col-sm-6 col-md-4 col-lg-3 post-3946 product type-product status-publish has-post-thumbnail jsn-master first instock shipping-taxable purchasable product-type-simple" data-expand="-100" >
该函数将返回li类。 请帮忙。