我正在使用wti\\U-like插件,这就是我如何获得作者喜欢的帖子数量(计数)
// Get the author object
$author = get_user_by( \'slug\', get_query_var( \'author_name\' ) );
// Get the post ids liked by the author
$like_ids = $wpdb->get_var("SELECT SUM(value) FROM {$wpdb->prefix}wti_like_post
WHERE user_id = {$author->ID} AND value > 0
GROUP BY post_id ORDER BY SUM(value) DESC");
?>
echo (int)$like_count;
如何查询作者喜欢的帖子并使用我的帖子格式在我的作者中显示它们。php模板?
ie:
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main"
< ?
$args = array(
//QUERY OPTIONS GOES HERE//
);
$wp_query->query( $args ); ?>
<?php if ( have_posts() ) : ? >