顯示我的崗位我是新來的wordpress,我有一個具有提供的CATEGORY_NAME後,它有一個內容,這裏是固定鏈接:http://localhost/jcjohn/2016/09/20/what-we-offer/
WordPress的我查詢後不
現在我想從我的章節頁面顯示我的文章的內容。
這裏是我的部分內部代碼:
<section id = "offer">
<?php
$args = array(
'type' => 'post',
'posts_per_page' => 3,
'category_name' => 'offer',
);
$offerBlog = new WP_Query($args);
if ($offerBlog->have_post()):
while ($offerBlog->have_posts()):
$offerBlog->the_post();
get_template_part('content', get_post_format());
endwhile;
endif;
wp_reset_postdata();
?>
</section>
變「型」到$ args變量「post_type」。 – vrajesh
@vrajesh謝謝你的回答,先生。仍然沒有輸出先生。請幫忙 –
嘗試:將get_template_part()函數替換爲the_content(); @jc John ..注意到您在「post_type」中添加了帖子作爲'post'.. – vrajesh