We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Stop showing duplicate posts on the same page/post using a different shortcode Reply To: Stop showing duplicate posts on the same page/post using a different shortcode

#15645
Tom
Keymaster

Hi Anna,

This is a tough one – I’m not sure it’s going to be possible to make the loops communicate with each other.

I do have one idea, but it’s a long shot. We’ll have to do this in a couple of steps to debug a lot the way:

add_filter( 'wp_show_posts_shortcode_args', function( $args ) {
    global $added_ids;
    var_dump($added_ids); // This should maybe output a list of all IDs output on the page. Does it?

    return $args;
} );

add_action( 'wpsp_before_header', function() {
    global $added_ids;

    $added_ids[] = get_the_ID();
} );

Does that output anything at all above each list?