我正在尝试获取特定用户的帖子ID列表。我使用以下代码:
<?php
$args = array(
'posts_per_page' => 5,
'orderby' => 'date',
'ignore_sticky_posts' => 1,
'author' => bp_get_following_ids(array( 'user_id' => get_current_user_id() ) ),
'post_type' => array ('user_images', 'post'),
'fields' => 'ids',
);
$myposts = get_posts( $args );
echo do_shortcode('[justified_image_grid preset=1 load_more=click recent_posts=yes post_ids='.$myposts.']');?>
但似乎没有任何想法?
答案 0 :(得分:0)
我不熟悉短代码,但它可能需要逗号分隔的帖子ID字符串:
implode( ',', $myposts )