我想創建一個存檔頁面,以此順序顯示帖子:使用wordpress創建存檔頁面
post_title | post_date | post_category
Offcourse這應該是點擊鏈接的帖子,或者如果你點擊某個類別比它應該鏈接到一個類別
什麼我到目前爲止有:
$args = array(
'post_type' => 'post'
);
$post_query = new WP_Query($args);
if($post_query->have_posts()) {
while($post_query->have_posts()) {
$post_query->the_post();
?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Link naar <?php the_title_attribute(); ?>"><?php the_title(); ?></a> | <?php the_date();?> | <?php get_the_category;?></h2>
<?php
}
}
?>
我知道, 「the_permalink()」給了我發佈的鏈接,「the_title」給了我標題。
此代碼僅顯示最近10個職位,而不是3000
另一個問題是,日期只顯示了對10個職位2。
該類別根本沒有顯示出來。
這是我第一次嘗試真正與wordpress合作,也許我真的這樣做是錯誤的方式,所以我希望你們都能幫助我。預先感謝。
感謝這個作品真的很好。通過這種方式,我可以繼續構建自定義存檔 – user3398922