Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Show posts in current category and specific tag Reply To: Show posts in current category and specific tag

#14231
Tom
Keymaster

So that’s showing that the condition is wrong.

Try adding this using one of these methods: https://docs.wpshowposts.com/article/adding-php/

add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
    $scores = get_crp_posts_id();

    $rel_posts = array_column( (array) $scores, 'ID' );

    if ( '340019' == $settings['list_id'] ) {
        $args['post__in'] = $rel_posts;
    }

    // This should output your IDS for the post__in value.
    var_dump($args);

    return $args;
}, 10, 2 );

Then this in your Element:

wpsp_display( 340019, $args );