• Resolved KurzBaginski

    (@kurzbaginski)


    Hello,
    is it possible to show only PDF Files in the search results on a specific page with a shortcode? In the “normal” search results in the main menu the results should show all files and posts. But on a specific page with a search box implemented with the shortcode I only want to show PDFs files in the results.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Yes. If your PDF files are regular WordPress attachments, you can use

    [searchform post_types="attachment"]
    Thread Starter KurzBaginski

    (@kurzbaginski)

    Thanks, I will try that.

    Thread Starter KurzBaginski

    (@kurzbaginski)

    I don’t want to display all PDFs from the library in the search box on the specific page. Is there a way to ensure that only certain PDFs, for example from a subfolder in the media library, are indexed?

    Plugin Author Mikko Saari

    (@msaari)

    Yes. You can easily use taxonomy (category, tag, etc.) or custom field filters. Media Library subfolders are likely possible, too, but that depends on how the subfolders are implemented. Relevanssi has lots of filters you can use to control what gets in the results and what doesn’t.

    The relevanssi_post_ok hook is used for this, if the standard category or custom field filters won’t do it for you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limit Search results to PDF files on specific page’ is closed to new replies.