达到特定元素重复 Custom Fiends
reaching specific element repeat Custom Fiends
我如何才能实现 css 高级自定义字段的特定内容重复?例如,第一个是 .class:first-child,最后一个是 team_one_thrid:last-child 但是关于 3º 呢?
你可以这样做:
$i = 0;
while(have_rows('repeater_field')){
the_row();
$i++;
?><div class="item<?php echo $i; ?>">
<!-- class item1, item2, item3... -->
</div><?php
}
增加变量 $i
并在 html 标签中使用它。
阅读一些手册后找出 :span:nth-child(2n+1) ,您也可以轻松达到任意数量的行重复。
我如何才能实现 css 高级自定义字段的特定内容重复?例如,第一个是 .class:first-child,最后一个是 team_one_thrid:last-child 但是关于 3º 呢?
你可以这样做:
$i = 0;
while(have_rows('repeater_field')){
the_row();
$i++;
?><div class="item<?php echo $i; ?>">
<!-- class item1, item2, item3... -->
</div><?php
}
增加变量 $i
并在 html 标签中使用它。
阅读一些手册后找出 :span:nth-child(2n+1) ,您也可以轻松达到任意数量的行重复。