WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Relevanssi and Widget Logic (3 posts)

  1. rlinn
    Member
    Posted 1 year ago #

    Since upgrading to v3 of Relevanssi, I am having trouble with my widgets.

    My site is built on Theme Hybrid and I use Widget Logic to control my widgets displaying. These two play nicely across my site except on the search page used by Relevanssi. See the following examples.

    1. Searching for hebrews.
    Theme Hybrid detects that the primary widget bar is disabled and sets the page width to 940px. However, Widget Logic decides to display the 'Pastor's Blog' widget using the logic in_category('pastors-blog') || is_category('pastors-blog'). This means width logic is detecting that the search page is related to the pastors-blog category.

    The first result returned by Relevanssi is a page post-type.

    2. Searching for cunningham.
    Theme Hybrid detects that the primary widget bar is enabled and sets the page width to 620px. However, Widget Logic decides not to display any widgets. This seems to be the opposite behaviour to the previous search.

    The first result returned by Relevanssi is a post post-type.

    3. Searching for barker.
    Theme Hybrid detects that the primary widget bar is disabled and sets the page width to 940px. Widget Logic decides not to display any widgets. Different behaviour again.

    The first result returned by Relevanssi is a sermon post-type.

    That'll do - I think you can see that something is not good. Any ideas how Relevanssi is breaking this?

    Thanks, Ryan.

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    This isn't really a Relevanssi issue - I tried this on my blog, and the problem is the same whether or not Relevanssi is enabled. That in_category() logic will trigger if the search results page has a post from that category, Relevanssi or not.

    You might want to add some more logic to your widgets - I don't know how complicated logic you can use, but perhaps you can add some checks for is_search() to make the logic work better on search results pages.

  3. rlinn
    Member
    Posted 1 year ago #

    Mikko,

    Thanks for doing the investigating for me. I've opted for a heavy-handed approach and simply disabled all widgets on the search page from functions.php using Justin Tadlock's technique and is_search().

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags