0
我有50个类别,我想在页面上显示10个类别,在下一页显示10个类别,在下一个页面上显示下一个10,以此类推导航。 我正在使用此代码。
但是没有任何导航创建。 但如何获得导航。如何使用导航获取类别?
$args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '0,10',
'taxonomy' => 'category',
'pad_counts' => false
);
$categories = get_categories($args);
// loop through the categries
foreach ($categories as $category) {
$cat_link = get_category_link($category->cat_ID);
echo '<a href="'.$cat_link.'">'.$category->name.'</a>'; // category link
echo "</br>";
}
?>
我的代码工作正常,并获得所有类别。我只需要导航。 thanx你能帮我这个.. –
如果这不能解决你的问题我猜这个问题的其他地方(你的其他代码,类$ category,...) – dabe