• Hey! Sadly the plugin isnt working with my theme, like it seems.
    Search cant find anything, no matter what.

    This is how the search.php looks:

    <?php
    $search_refer = $_GET["post_type"];
    if ($search_refer == 'post') { load_template(TEMPLATEPATH . '/search-post.php'); }else{
    load_template(TEMPLATEPATH . '/search-portfolio.php'); }
    ?>

    and this is how the includes look:

    https://pastebin.com/Hcb1r6Zt

    Please help me fixing it!

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

    (@msaari)

    Yes, this line is the problem:

    $new_query = new WP_Query($args );

    This drops Relevanssi out of the loop. Remove that line and all cases of $new_query-> and the search should work just fine.

    Thread Starter lodoubleg

    (@lodoubleg)

    Thanks for your fast replie! I tried commenting the parts out, but this breaks the output.
    When uncommented, the whole result page is white with nothing displayed, not even “Nothing found”.
    Also the Footer is missing then.

    This is how the Template looks after editing:

    https://pastebin.com/S2sZv65K

    edit: there is no error thrown with debug on true

    • This reply was modified 8 years, 5 months ago by lodoubleg.
    Thread Starter lodoubleg

    (@lodoubleg)

    oh i missread “$new_query->” and “$new_query =” …
    let me mess around with the template more and let me see if i can get it working ??
    thanks again

    Thread Starter lodoubleg

    (@lodoubleg)

    Ok, i uncommented everything as you suggested and the page layout is now correct, but the result page is empty. It looks like the plugin cant hook into my theme ??

    This is how the edited file looks:

    https://pastebin.com/1Bptwuwp

    i double checked it and it has no custom hooks left.

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, the page is empty, as you removed the whole post loop there =)

    Instead of:

    <?php if ( $new_query->have_posts() ) : ?>

    you should have:

    <?php if ( have_posts() ) : ?>

    That’s what I meant when I said you need to remove the $new_query-> bits. That’s twice in the file, then there’s the $new_query->the_post(); that needs to become the_post();.

    Uncomment everything else (except this: //$new_query = new WP_Query($args ); –?that’s correct now), and the search should work fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search finds nothing’ is closed to new replies.