我正在尝试使用 query_posts 从类别中检索帖子,但它从未指定的类别中返回帖子,其他参数(例如排序和 showposts)可以正常工作。
extract(shortcode_atts(array(
'categories' => 'Partners',
'imageswidth' => '200px',
'imagesheight' => '115px',
'imageslink' => 'Web_Link',
'partnerscount' => 'All',
'columnscount' => 1,
'imagescrop' => 'No',
'imagesblackhovercolor' => 'No',
'imagesopacity' => 100,
'imagesgrayscale' => 'No',
'imagescolorize' => '',
'imagesnegative' => 'No',
'imagessort' => 'Date ASC'
), $atts));
//$args = "category_name=".categories;
//$catIDs = get_cat_ID( $cat_name='Partners' );
$args = "cat_name=".categories;
$args .= strtolower($partnerscount) != "all" ? "&showposts=".$partnerscount : '';
$args .= $imagessort == "Date_ASC" ? "&orderby=date&order=ASC" : '';
$args .= $imagessort == "Date_DSC" ? "&orderby=date&order=DESC" : '';
$args .= $imagessort == "Random" ? "&orderby=rand" : '';
query_posts($args);
while ( have_posts() ) : the_post();
{
$output = $output.get_the_title();
}