Forums Forums Search & Filter Pro Is there a way to exclude the the current Post ID?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #182628

    On a news page I am pulling through other news articles using search & Filter Pro, I would like to exclude the current News article from being pulled through from the list.

    Is there a variable or dynamic way to get the current post id to enter into “Exclude Post IDs”?

    I am displaying as a widget if that makes a difference.

    Trevor
    #182666

    So, you have a single post on the page and a loop of other posts? The only way to do this would be for you to custom code some PHP to get the current post ID (using the WordPress get_the_ID() function I would guess). Then you can use this in our Edit Query Arguments filter and add an argument to the filter to exclude that post:

    https://searchandfilter.com/documentation/action-filter-reference/#edit_query_arguments

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