我有一个自定义帖子类型,在自定义主题的一个页面上我不会显示几个帖子类型和下面阅读更多,当您点击阅读更多所有帖子类型应显示在一个页面上使用自定义模板。我尝试使用single.php,但没有运气。
此部分显示标题为链接的页面上的10个帖子
$args = array( 'post_type' => 'faq', 'posts_per_page' => 10);
$faq = new WP_Query( $args );
while($faq->have_posts()) {
// create a new number_row block
$tpl->newBlock ( "faq-item" );
$faq->the_post();
// assign values
$tpl->assign ( "link", get_the_permalink() );
$tpl->assign ( "title", get_the_title() );
$tpl->assign ( "text", get_the_excerpt() );
}
并且tpl页面上的这一部分显示了来自控制器的10个帖子:
<div class=" {category-faq} col-xs-12 col-sm-12 col-md-12 col-lg-12 pad-top-fixed-5 pad-right-percent-0 pad-bottom-fixed-10 pad-left-percent-0 blue-navy-f-1 font-14" >
<a href="{link}"> {title} </a>
</div>
我只需要在这10个以下显示链接阅读更多并进入所有常见问题列表的页面
这是一个新页面,我需要显示所有帖子。
<!-- INCLUDE BLOCK : header -->
<!-- Building unknown container -->
<div class="row container-fluid pad-left-percent-19 pad-right-percent-19 gray-bg-1" style="min-height: 700px;>
<!-- Row 1 -->
<div class=" col-xs-12 col-sm-12 col-md-12 col-lg-12 pad-all-0 ">
<!-- Full width right and left -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-9 pad-all-0">
<div class="row-fluid">
<div id="border-right-1" class="col-xs-12 col-sm-12 col-md-12 col-lg-12 marg-top-fixed-15 pad-left-percent-0 ">
<p class="blue-navy-f-2 font-12 gray-f-2"><a href="/residential">Home</a><a href="/help-and-advice/">/Help and Advice</a></p>
<!-- Color for entire left 9/12 column -->
<p class="font-50 font-l-600 font-f-bariol-regular gray-f-4 pad-bottom-percent-1">{title}</p>
<p class="font-14 gray-f-2 pad-bottom-percent-1">{content}</p>
</div>
<!-- End of Registering interest column -->
</div>
</div> <!-- End of Color for entire left 9/12 column -->
</div> <!-- Color for entire left 9/12 column -->
<div id="get-touch-bu" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 marg-top-fixed-15" >
<div id="get-touch-bu" class="pad-left-fixed-15 pad-top-percent-10" >
<!-- INCLUDE BLOCK : twitter -->
</div>
</div>
</div> <!-- End Full width right and left -->
</div><!-- Row 1 -->
<!-- End of List container row -->