0
我加載在WordPress的類別列表使用此功能:WordPress的分類列表鏈接的帖子發表
<?php wp_list_cats($args = array('current_category' => 0, 'hide_empty' => 1));?>
誰能告訴我怎樣才能讓類別鏈接鏈接到第一類張貼?
即:
目前A類的鏈接網址... /分類/類別的一個
我想A類鏈接到它的第一個帖子這樣反而網址... /類別-a /第一後
我試圖chaning其工作witht他的分類模板如下:
<?php
/*
Redirect To First Child
*/
if (have_posts()) {
while (have_posts()) {
the_post();
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
$firstchild = $pagekids[0];
wp_redirect(get_permalink($firstchild->ID));
}
}
?>
我只是需要一個更簡潔的解決方案,我不需要修改實際wordp雷斯文件。
感謝
似乎'wp_list_cats()'被棄用,使用'wp_list_categories()' – Danijel 2013-05-11 19:50:42