去几个谷歌搜索后,我完成这个代码(在PHP不太好)WordPress的帖子类别名称的链接
<div>
<?php
$args = array(
'post_type' => 'post'
);
$categories = get_categories($args);
$catlinks = get_category_link($categories);
foreach ($categories as $category) {
echo '<a href=" '.$catlink->link . '"> <h2>' . $category->name .'</h2></a>';
$args['category'] = $category->term_id;
} ?>
</div>
这个代码显示的WordPress发布分类的循环,即时通讯试图让每个类别链接,但我仍然没有得到正确的链接。
任何提前的帮助将是伟大的。
感谢罗德里戈
TYVM曾任职完美! –