• jmaiorino

    (@jmaiorino)


    Hi there,

    I am trying to use your plugin to override the basic WordPress search in my theme. I read your troubleshooting and tried to delete/edit out the ‘get_query()’ portion in my child theme’s search.php file, but nothing seemed to change (it either stayed as the normal search or returned a fatal error).

    Here is the only place in search.php that the call shows up:

    // Final query
    if ($wp_query->is_search) {
    query_posts( array_merge( $args, $wp_query->query) );
    }
    */

    Am I doing this correctly? Thank you in advance!

    The page I need help with: [log in to see the link]

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

    (@msaari)

    Can you show me the whole search.php file, please? Put it in a Pastebin. Can’t tell from a small snippet.

    Thread Starter jmaiorino

    (@jmaiorino)

    Thanks! Here’s the link to the Pastern: https://pastebin.com/RWGcQmXu

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, that template is doing a lot of stuff that shouldn’t be in a search results template, but should actually be in a pre_get_posts filter hook. If they were, then this would work fine with Relevanssi. Now it needs some work.

    Looks like you’ve commented out all the problematic parts, though, so the rest should work with Relevanssi.

    If that doesn’t work, try just commenting out these two lines, and nothing more:

    add_filter('pre_get_posts','tm_page_search_filter');

    query_posts( array_merge( $args, $wp_query->query) );

    Does that work?

    Thread Starter jmaiorino

    (@jmaiorino)

    Darn, still no luck. Nothing changes!

    Plugin Author Mikko Saari

    (@msaari)

    There’s still tons of stuff in that search results template. What if you start from scratch? Create a search results template with a basic loop in it (here’s a pretty good example), and then once you get that to work with Relevanssi, add features as necessary.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not working with theme’ is closed to new replies.