我知道如何使用wordpress循环, 但是不确定如何创建在表中显示循环的逻辑。
我想在表格单元格中显示每个帖子, 但是每第4个帖子都会创建一个新行, 因此我的表格有4列, 并根据需要提供了许多行。
忠告?
#1
例如:-你可以执行以下操作…
<table>
<?php $i = 0;?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if($i == 0){ echo "<tr>"; }?>
<td>//Your Data..</td>
<?php $i++;?>
<?php if($i == 4){ echo "</tr>"; $i=0;}?>
<?php endwhile; ?>
<?php if($i < 4) echo '</tr>'; ?>
</table>
来源:
https://www.srcmini02.com/67686.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_39940.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57