我想创建一个表来显示所有帖子,我使用WP\\u query来获取所有iformatio,并创建表模板来列出我的帖子。但我的问题是桌子里只有一个帖子。。我想把所有的都包括在表中。
$wpb_all_query = new WP_Query(array(\'post_type\'=>\'vendor_management\', \'post_status\'=>\'new\', \'posts_per_page\'=>-1)); ?>
<?php if ( $wpb_all_query->have_posts() ) : ?>
<table class="responstable">
<thead>
<tr>
<th></th>
<th>Vendor Name</th>
</tr>
</thead>
<tbody>
<tr>
<?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
<td><input type="checkbox"/></td>
<td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
</tr>
</tbody>
</table>
<?php endwhile; ?>
<!-- end of the loop -->
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
<?php endif; ?>
基本上,我想在后端创建一个类似admin的表,它显示所有帖子,包括编辑、删除、批量删除到前端,任何人都可以告诉我怎么做。我尝试使用WP\\U List\\U表格,但如果在前端,则无法工作。