Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

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)
  • Digital
    #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 Moderator
    #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)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.