Forums Forums Search & Filter Pro Way to show other posts if results are less than X

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

    I have a page where I want to show three results which match the filters. In some cases, there may only be one or two matches. Is there a way for me to detect this and then display one or two other random posts so there are always three posts displaying? Perhaps some kind of callback when the filter runs?

    Trevor
    #103846

    How do you limit it to 3 results, or do you know that will be the maximum? Whenever a post query is run in WordPress, it makes available to total results count (found_posts), so you could use this to decided what else to add. The Codex page is here.

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