我一直在努力使以下代码工作,但它只是不起作用,我想知道可能是什么原因。
$args = array(
'post_type' => 'project',
'tax_query' => array(
array(
'taxonomy' => 'categories_project',
'field' => 'slug'
)
)
);
$wp_query = new WP_Query( $args );
跑步<?php echo $GLOBALS['wp_query']->request; ?>
让我明白:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
INNER JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (53) )
AND wp_posts.post_type = 'project'
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
LIMIT 0, 3
任何帮助都将受到高度评价。谢谢!