您可以在免费页面行主题中执行类似于以下代码段的结构的操作,这里我使用引导程序将其显示在三列中。
只需遵循相同的基本结构,并将其应用于主题,我认为这可能会帮助您在三列中显示不同的类别。
<div class="row">
<div class="col s4">
<?php
$args = array( \'posts_per_page\' => 8, \'category_name\' => \'your-category\' );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );
if (have_posts()) {
the_title();
get_the_content();
// and other function in the_loop
}
endforeach;
wp_reset_postdata();
?>
</div>
<div class="col s4">
<?php
$args = array( \'posts_per_page\' => 8, \'category_name\' => \'your-category\' );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );
if (have_posts()) {
the_title();
get_the_content();
// and other function in the_loop
}
endforeach;
wp_reset_postdata();
?>
</div>
<div class="col s4">
<?php
$args = array( \'posts_per_page\' => 8, \'category_name\' => \'your-category\' );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );
if (have_posts()) {
the_title();
get_the_content();
// and other function in the_loop
}
endforeach;
wp_reset_postdata();
?>
</div>
</div>
请在此链接中阅读wordpress的官方文档
https://codex.wordpress.org/Template_Tags/get_posts