我有我自己的主題,我想從特定類別在我的主頁上顯示帖子。如何使用slu get從類別中獲取帖子?
到目前爲止,我已經這樣實現的:
<?php
global $post;
$args = array('numberposts' => 10, 'category' => 6);
$posts = get_posts($args);
foreach($posts as $post): setup_postdata($post);
?>
<divs with the_title() the_excerpt() etc ></div>
<?php
endforeach;
?>
但是,如果我想獲得由它的蛞蝓種類是什麼?或者可以在管理面板中簡單地創建類別選擇框?
@IoQ如何使用此代碼分頁? – Amin
非常感謝,你爲我節省了時間 – Bellash