Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Those parameters should work regardless of the post type setting. Have you made any code changes using the display posts filters?

    I recommend debugging by filtering the args. On a staging or local environment (not your live website) add the following code to your functions.php file:

    
    add_filter( 'display_posts_shortcode_args', function( $args ) {
    print_r( $args );
    exit;
    } );
    

    That should display the arguments being passed to WP_Query right here which should help you track down the issue.

    Thread Starter heyjoecampbell

    (@heyjoecampbell)

    When I first had issues, I tried using the “Exclude posts already displayed” snippet on your website, but I have since removed it, as it did not resolve the issue.

    Here’s the output I receive when using the filter you provided:

    Array ( [perm] => readable [order] => desc [orderby] => date [post_type] => Array ( [0] => help ) [posts_per_page] => 10 [post__not_in] => Array ( [0] => 9087 ) [post_status] => Array ( [0] => publish ) [tax_query] => Array ( [0] => Array ( [taxonomy] => help_taxonomy [field] => slug [terms] => Array ( [0] => submissions ) [operator] => IN [include_children] => 1 ) ) )

    Here’s the code I am using in my template:

    echo do_shortcode('[display-posts wrapper="ul" wrapper_class="grey-doc" post_type="help" taxonomy="help_taxonomy" tax_term="current" exclude_current="true"]');

    Any assistance would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude Current for CPT’ is closed to new replies.