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 信息

猜你喜欢

转载自www.cnblogs.com/ryanzheng/p/11982036.html
今日推荐