wordpress 获取指定作者的所有 post meta

 $args = array( 
    'post_type' => array( 'post','knowledgebase'), 
    'post_status' => 'publish',
    'author'    =>  $author_id,
    'numberposts'=> $author_all_posts
);
post_title
$posts = get_posts($args);
$votes_likes_sum = 0;
for ($i = 0; $i < count($posts); $i++) {
    $votes_likes_sum += get_post_meta($posts[$i]->ID, '_votes_likes', true);
}
echo $votes_likes_sum;
$post = $posts[0];
echo $post->ID;
print get_post_meta(1357, '_votes_likes', true);

 

获取指定作者的所有 Post Meta 信息

posted @ 2019-12-04 11:55  Ryan_zheng  阅读(563)  评论(0编辑  收藏  举报