我需要创建一个类似于此图像的表,我希望在特定的DIV中有一个特定的术语,但我的代码会一起出现。
Example: 一个div棕色,有5种产品。
我想要的效果就像手风琴“隐藏和显示”
因此,如果我没有所有相同的隐藏和显示,查询将无法工作。每个学期的最终结果都必须像div上的这幅图像一样。此时,我有一个包含所有条款的div。
如何创建一个div,每个div都有您的术语?
谢谢你的帮助。
<?php
$args = array (
\'post_type\'=> \'coleccoes\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'tag-series\',
\'field\' => \'slug\',
\'terms\' => array(\'casegoods\',\'rugs\',\'lighting\',\'seating\')))); ?>
<div id="coleccao_casegood">
<?php $list_query = new WP_Query($args);
while ($list_query->have_posts()) : $list_query->the_post();
if( has_term( \'rugs\', \'tag-series\' ) ) {
echo \'<h3 class="imagem">\';
the_post_thumbnail();
echo \'</h3>\';
echo \'<div class="conteudo" style="top: 650px; position: absolute;">\';
the_content();
echo \'</div>\';
} elseif ( has_term( \'seating\', \'tag-series\' ) ) {
echo \'<h3 class="imagem">\';
the_post_thumbnail();
echo \'</h3>\';
echo \'<div class="conteudo" style="top: 650px; position: absolute;">\';
the_content();
echo \'</div>\';
} elseif ( has_term( \'lighting\', \'tag-series\' ) ) {
echo \'<h3 class="imagem">\';
the_post_thumbnail();
echo \'</h3>\';
echo \'<div class="conteudo" style="top: 650px; position: absolute;">\';
the_content();
echo \'</div>\';
} elseif ( has_term( \'casegoods\', \'tag-series\' ) ) {
echo \'<h3 class="imagem">\';
the_post_thumbnail();
echo \'</h3>\';
echo \'<div class="conteudo" style="top: 650px; position: absolute;">\';
the_content();
echo \'</div>\';
}
endwhile;
wp_reset_query();
?>
</div>
<!-- fim div_collection -->
<script>
$(document).ready(function() {
$(\'div.conteudo\').hide();
$(\'h3.imagem\').click(function() {
$(this).next(\'div\').slideToggle(\'fast\')
.siblings(\'div:visible\').slideUp(\'fast\');
});
});
</script>
It is thus