Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Patzman

    (@patzman)

    Ok, i solved it by myself.

    I am using the plugin “Relevanssi” wich is not searching the ID by default.

    But, if I add the following filter to functions.php of my theme it will do exactly what i want. And it wors with “Search & Filter” plugin

    Here is the code snippet for the functions.php:

    add_filter(‘relevanssi_content_to_index’, ‘rlv_index_post_id’, 10, 2);
    function rlv_index_post_id($content, $post) {
    $content .= ” ” . $post->ID;
    return $content;

    Hope it helps somebody….

    Plugin Author DesignsAndCode

    (@designsandcode)

    Thanks – I was going to suggest Relevanssi but wasn’t sure if it was capable of searching IDs – thanks for the code snippet ??

    Thread Starter Patzman

    (@patzman)

    Hey, no problem. Been a pleasure..

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