0
這是我的代碼,用於獲取每個類別的所有最新帖子。當我點擊它顯示相同頁面的類別時,我正面臨專業類別。點擊類別後顯示相同的頁面?
$category_ids = get_all_category_ids();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
foreach($category_ids as $kk=> $cat_id) {
$cat_name= query_posts('cat='.$cat_id.'&posts_per_page=1&orderby=date&order=ASC&paged='.$paged);
foreach($cat_name as $post) : setup_postdata($post);
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<?php
}
else {
?>
<?php if(get_the_category_list()) { ?><p class="alignleft"><span><?php the_category(', ') ?></span></p><?php } ?>
endwhile;
endif;
請幫助 感謝