Avada is one of the most popular WordPress themes on the market.
All post types are not found
Avada has search settings, including a list of post types to show in the results. If your Avada search is not showing all post types, attachments or user profiles, the problem is probably in the Avada settings. It’s best to empty that option.
If you have not chosen any post types in the Avada settings, Avada will leave the control of the post types to Relevanssi, which will then show only those post types you’ve chosen to include.
Fixing excerpts
Avada uses a custom method of displaying excerpts, which is unfortunately not compatible with Relevanssi. This function will fix the issue from versions 5.6 onwards:
if ( ! function_exists( 'fusion_get_post_content_excerpt' ) ) { function fusion_get_post_content_excerpt( $limit = 285, $strip_html, $page_id = '' ) { global $post; return $post->post_excerpt; } }
It’s simple as this. All you need to do is to add this function to your site, and you should have working Relevanssi-generated custom excerpts.
hi, unfortunately i still cant make your plugin work with avada? i ha ve deleted the suggested line in search.php and it is still not able to find any results at all.
any suggestions?
indexing:
Documents in the index: 234
Terms in the index: 9017
Highest post ID indexed: 1803
Can you show me the complete search.php in your theme? Put it in a pastebin and link here.
here you go:
http://pastebin.com/WnNEFMsB
thanks alot
There are no problems with your search.php, so it’s something else. Is your site perhaps limiting the search somehow to a particular category or a post type?
i doubt it before installing your plugin i was getting search results from post, pages, and custom post type within title and content.
the only reason i installed relevanssi is because i want the search results to include Custom Field for my custom post type
thank you,
Well, something’s off, it’s not in your search.php file and that’s just about all I can say without seeing your site.
Alright, I’ll see if I can find an alternative solution.
Your plugin looked very good tho.
Thank you
Hello, seems like Relevanssi is broken again with Avada (v3.8), sadly. They changed the search.php so much that above mentioned fixed doesn’t apply anymore. Here’s the new search.php: http://pastebin.com/VaaSe9Mw
A fix would be highly appreciated, thanks a lot!
Hi, nothing wrong with that search.php template. I’d need to see a complete site with the theme, with the ability to edit template and plugin files, to figure out if there’s a solution.
I can confirm that the “did you mean” is broken with with Avada v3.9.2. If there is anything I can do to assist (test, provide details, etc), please let me know.
Does the search work otherwise? How exactly is the “did you mean” broken?
I have added
<?php if (function_exists('relevanssi_didyoumean')) { relevanssi_didyoumean(get_search_query(), "Did you mean: ", "", 5);"
to the search.php in the Child Theme. I’ve put it before the have_posts(). It however does appear to do anything.I do see search requests being logged at Dashboard > User searches.
I also excluded some pages from the search and that works too.
PS off topic: the search hit highlighting doesn’t seem to work either with the avada theme.
I’d need full access (WP Admin and FTP) on a site, or a copy of the theme.
Can you send me an e-mail (carlo.kool@gmail.com) so I can provide you with the details required? Or do you provide a different medium to exchanges this?
The Did you mean function works as it should when I try it. If you’re using the free version of Relevanssi, do note that it requires a good amount of logged queries in order to work well. If user logs are not enabled, it doesn’t work at all, and if there are not enough logs, it can’t always suggest good results.
Premium has a much better Did you mean function that doesn’t require logs and instead uses the database as the source for corrections.
Search hit highlighting works with the default Avada child theme, no problems. You may want to disable “Strip HTML from Excerpt” option under Blog settings in Avada, but it wasn’t necessary when I tried it, I still got the highlights with no problems.
My website is live now and the amount of logged queries is growing. Now the “did you mean” is indeed working. Thank you for your assistance in this matter.
I simply impelemented the following code in the search.php using the Avada Child theme:
<?php if (function_exists('relevanssi_didyoumean')) { relevanssi_didyoumean(get_search_query(), "<p>Did you mean: ", "</p>", 5); }?>
I hope this posts helps others too.
Hi. I use that theme (3.9.1 version). Can you tell me, in what line of search.php i should insert your code? What else should i do to make that search plugin work?
My friends, can you give step by step insruction how to implement search in the newest avada theme.
I put code from gezonde recepten
to search.php in avada theme folder. But it broke search completely. What am i doing wrong?
Since the code has the PHP code tags around it, you need to make sure you put it in the right place, outside any PHP code tags. If you put it inside PHP code tags, then yes, it’ll break the whole page.
Can you please tell me where should i insert it?
That would depend on where you want it to appear in your search results template. If you have the same version of Avada as I have, third line of the search results template would probably be fine (inside the #content div, outside the if (have_posts()) conditional).
I am too bad in coding, can you please insert that code in to apropriate place of my search.php
https://docs.google.com/document/d/1lSSUF52izc7TmdzSV8PGzGl5M6bWP7BFy8XlqkrJQjc/edit?usp=sharing
Thank you!
Third line should work.
Still save avada’s search results page with nothing indexed be Relevanssi (
Do you have a complete index in Relevanssi settings?
Yes, I have. Maybe it is because of russian language?
My search.php
http://pastebin.com/LzssP6PC
No, Russian isn’t a problem. So, what exactly is the problem? How does the search not work?
No results.
you can try http://eviped.com/?s=%D0%BF%D0%B5%D0%B4%D0%B8%D0%B0%D1%82%D1%80%D0%B8%D1%8F
I think it is that theme problem.
That search sure doesn’t work, but this does: http://eviped.com/?s=turpis
Can you show me the post your search was supposed to find?
So my search.php looks like that
<div id="content" layout->add_class( ‘content_class’ ); ?> layout->add_style( ‘content_style’ ); ?>>
settings->get( ‘search_new_search_position’ ) == ‘bottom’ ) {
get_template_part( ‘templates/blog’, ‘layout’ );
?>
settings->get( ‘search_new_search_position’ ) != ‘hidden’ ) : ?>
<div class="search-page-search-form search-page-search-form-settings->get( ‘search_new_search_position’ ); ?>”>
<form class="searchform seach-form" role="search" method="get" action="”>
<input type="text" value="" name="s" class="s" placeholder="”/>
settings->get( ‘search_new_search_position’ ) == ‘top’ || Avada()->settings->get( ‘search_new_search_position’ ) == ‘hidden’ ) {
get_template_part( ‘templates/blog’, ‘layout’ );
}
?>
template->title_template( $title );
?>
settings->get( ‘checklist_circle’ ) ) {
$circle_class = ‘circle-yes’;
} else {
$circle_class = ‘circle-no’;
}
wp_nav_menu( array( ‘theme_location’ => ‘404_pages’, ‘depth’ => 1, ‘container’ => false, ‘menu_class’ => ‘error-menu list-icon list-icon-arrow ‘ . $circle_class, ‘echo’ => 1 ) );
?>
<?php get_footer();
// Omit closing PHP tag to avoid "Headers already sent" issues.
How I should change it? Please paste as comment if possible. Thanks in advance.
Hello,
Is there any update if latest Avada theme actually works out of the box with Relevanssi plugin?
Many thanks for the reply!
Pavel
Pavel, no idea – I don’t have access to Avada updates. I haven’t heard anything in either direction.
it works, with the latest version of avada
Hello, I’m working on a page. We are trying to improve our page with this plugin before buying it, but it does not work. When we type something the plugin just not return anything, although, if we use, for example, “Ajax search lite” we can see results. Our Avada version is 6.2.2, and we installed the latest version of relevanssi. I can`t give you our URL because only works with a VPN. I`d like to know if you could help us with this problem.
I’m sorry, but 5.2.2 is the latest version of Avada I have access to, so I don’t know what’s the problem with Avada 6.2.2. Have you tried the Relevanssi admin search (Dashboard > Admin search)? That’ll tell you whether Relevanssi search works in the first place or not. If the admin search works and the front end search doesn’t, the problem is in Avada somehow, but as I don’t have access to that version of Avada, I can’t tell what the problem is.
Your theme is out of date. Try updating it to the latest version. It works on mine, however the Avada live search doesn’t show any results when searching by SKU. The results page works, but the live search doesn’t.
The Avada live search does not use Relevanssi. It could be made to use Relevanssi, but that would require action from Avada. I’d be happy to help, so I would recommend telling Avada support that you want the live search to support Relevanssi.
I would like to help so that your plugin can be used in Avada again. How can I help?
Marco, Relevanssi should work fine with Avada (with the caveats listed on this page). Are you having problems that are not mentioned here?
Is this still the correct code? I created a code snippet using the Code Snippets plugin but the plugin returns an error and won’t activate the snippet.
KS, I don’t follow Avada development, so I don’t know if this works or not. However, I know for sure it shouldn’t cause any errors. Make sure the snippet is copied exactly as is so that there are no typos in it.
Thanks Mikko. I am a beginner when it comes to PHP and template editing. Maybe you can help me? I used the Snippets plugin but it returns the error “The snippet has been deactivated due to an error on line 2: Cannot redeclare function fusion_get_post_content_excerpt.”
What am I missing?
KS, you’re redefining an existing function. If you want to do that from a Snippet, you need to do it like this:
Hurrah! That worked. Thank you so much. Could this info maybe be added to main help text above…?
Just glad this works now – much better.
This is the website I am working on: https://kemeny.ca/blog/
I am trying to make the highlighting of terms work in the search results.
Didn’t work with this site: https://healthy-protein.com/ and removed search at the moment. Hopefully you will make it work better with Avada Theme.
There are no problems with Avada that need fixing as far as I can tell, but of course, it’s also possible to set up an Avada site so that it does not work with Relevanssi. But in general, Relevanssi and Avada play nice together.
Just wanted to add that this fix works fine with the current Avada version (7.9.2). Thank you so much for thinking of us Avada users. 🙂