0
問題我正在根據用戶所在的類別返回側邊欄中的一些數據。截至目前,我正在填充側欄中「新聞」類別的一些縮略圖,其中被證明是有問題的。這是由於我查詢(從'新聞'類)我想要拉的縮略圖後,我注意到它阻止我訪問當前的'博客'類查詢。我該如何返回到當前的分類查詢?Wordpress WP_Query,返回當前查詢
<?php the_category(', ') ?> // This Returns 'Blog'
<?php
$args = array('numberposts' => 2, 'category' => 4);
$postslist = get_posts($args);
foreach ($postslist as $post) : setup_postdata($post); ?>
<div>generic return values</div>
<?php endforeach; ?>
<?php the_category(', ') ?> // This Returns 'Press', I want this to return 'Blog'
這奏效了,感謝您的幫助帕特! – Starboy 2012-03-02 20:32:47