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

    (@msaari)

    No. Relevanssi does understand the WP_Query p parameter to restrict the search by post ID.

    However, if you want to search by post ID, it’s very simple to make that happen:

    add_filter('relevanssi_content_to_index', 'rlv_index_post_id', 10, 2);
    function rlv_index_post_id($content, $post) {
        $content .= " " . $post->ID;
        return $content;
    }

    Add that to theme functions.php, reindex and searching for post ID’s works.

    Thread Starter killerdog

    (@killerdog)

    Wow, thanks for the quick reply and amazingly positive answer. Much appreciated. ??

    Helped me a lot.. thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search for any post ID’ is closed to new replies.