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.
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:
http://pastebin.com/S2sZv65K
edit: there is no error thrown with debug on true
-
This reply was modified 9 years, 6 months ago by
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
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:
http://pastebin.com/1Bptwuwp
i double checked it and it has no custom hooks left.
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.