• Resolved armandl

    (@armandl)


    Hello,

    Is there a way to force the results to be the same for users who are not logged in? When I am logged in to WP, the results are the way I would like them to be, but some are missing when I am not logged in.

    I have added a new post_status (archive) and have added this into the valid post status list in Relevanssi. This managed to get my archived post_status posts into the search results, but only when I am logged in.

    Any suggestions? I know this may be sort of a bizarre request but I am hoping you can help. Really appreciate it!!

    Thanks,
    Larissa

    https://www.ads-software.com/plugins/relevanssi/

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

    (@msaari)

    Adding this function to your theme functions.php should do the trick:

    add_filter('relevanssi_post_ok', 'rlv_allow_status', 10, 2);
    function rlv_allow_status($ok, $doc) {
        $status = relevanssi_get_post_status($doc);
        if ("archive" == $status) $ok = true;
        return $ok;
    }
    Thread Starter armandl

    (@armandl)

    Yes, this looks like it works perfectly. Thank you so much!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Results Different for Logged In Users’ is closed to new replies.