当前位置:首页 > Web开发 > 正文

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

2024-03-31 Web开发

$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);

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/41639.html