Php wordpress中的相关公文包查询
我使用wordpress 3.8.1,想展示5个相关的公文包,但我不知道如何查询。 我注册投资组合的代码是Php wordpress中的相关公文包查询,php,mysql,wordpress,Php,Mysql,Wordpress,我使用wordpress 3.8.1,想展示5个相关的公文包,但我不知道如何查询。 我注册投资组合的代码是 add_action('init', 'portfolio_register'); 函数组合_寄存器{ }我终于找到了答案 $args=array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 's
add_action('init', 'portfolio_register');
函数组合_寄存器{
}我终于找到了答案
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>3, // Number of related posts that will be shown.
'post_type'=> 'portfolio'
);
$my_query = new wp_query($args);
最好的
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>3, // Number of related posts that will be shown.
'post_type'=> 'portfolio'
);
$my_query = new wp_query($args);