Using “Search” for searching all questions displaying all results?
When a website visitor is using “Search” for searching all questions, rather than displaying the results from their specific search the content below is just the list of all results.
Also, I see that Ans 4.1.5 is out, but WP repository doesn’t show that it isn’t available?
Hello Michael,
Search is working fine. You can try it on demo: Search.
4.1.5 is not published to wp.org because I discovered few bugs yesterday which was fixed but will wait for contributors input. Thanks for your patience.
I have the same issue:
Default theme search string overwrites anspress search. I am using “smart mag” theme and the search string looks like one below, which is identical to anspress search string.
/?s=anspress
this might not be an isolated case, as Michael as highlighted this issue.
________
@Rahul, do you think it’s possible to make anspress search string different from the default one that themes use?
I consider buying the askbug theme as well but if I can’t use the search, i can’t move forward.
Thanks,
Florin
Okay. Let me think, what can I do here. I will add it to our current roadmap. Thanks for reporting.
Hi Rahul,
for themes like the one that florinb has, who have an option to include just “posts” in search, i think you need to add the post_type to your “loop_start” hook from qaquery_hooks.php .
so instead of
if ( $query->is_main_query() && $query->is_single() && ‘question’ === get_query_var( ‘post_type’ ) ) {
$query->posts[0]->post_content = ‘[anspress]’;
}
you should have
if ( $query->is_main_query() && $query->is_single() && ‘question’ === get_query_var( ‘post_type’ ) ) {
$query->posts[0]->post_content = ‘[anspress]’;
$query->posts[0]->post_type = ‘post’;
}
this way, you’ll make sure your injected post is treated as a “post”.
Hello,
Thanks for your suggestion. I will give it a try.
Hello Rahul,
So if my search function is not working then I most likely have some sort of plugin/theme conflict?
Hello Michael,
Have you tried source from GitHub master branch?
search box no working