Skip Navigation

[Fermé] Adding Relevanssi breaks template of results page

This support ticket is created Il y a 7 années et 6 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 réponses, has 2 voix.

Last updated by Nigel Il y a 7 années et 6 mois.

Assisted by: Nigel.

Auteur
Publications
#440964
NoResults.JPG
WithRelevanssi.JPG
WithoutRelevanssi.JPG

I am trying to add Relevanssi search-results to my search-site. Before enabling the Relevanssi-Plugin, everything worked fine. After enabling Relevanssi search, my results-page doesn't show all related infos. My settings are:

A simple wp-text-search-field in the header of my site:

<form role="search" method="get" id="searchform" class="searchform" action="<em><u>hidden link</u></em>">
        <label class="sr-only" for="s">Suche nach:</label>
        <input type="submit" id="searchsubmit" class="btn btn-search" value="">
        <input type="text" value="" placeholder="Suche ..." name="s" id="s">
</form>

A Toolset WordPress-Archive for search-results:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	  <h1>Ihre Suchergebnisse zu "[wpv-search-term]"</h1>
		<wpv-loop>
          <h5>[wpv-post-link]</h5>
          [trim wordlimit="24"][wpv-post-excerpt][/trim]
          [trim wordlimit="24"][types field='kurz-text'][/types][/trim] 
          [trim wordlimit="24"][types field='studie-ergebnisse'][/types][/trim]
          <a class="btn search" href="[wpv-post-url id='$parent']#[wpv-post-slug]">Weiterlesen ...</a>
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]Keine Suchergebnisse gefunden[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

The custom shortcode [trim] is for trimming my text to 24 words, like this:

add_shortcode('trim', 'func_trim');
function func_trim($atts, $content = '') {
    $content = wpv_do_shortcode($content);
    $wordlimit = (int)$atts['wordlimit'];
    $words = explode(' ', $content, ($wordlimit + 1));
    if(count($words) > $wordlimit) {
        array_pop($words);
        $content = implode(' ', $words);
        $content .= ' &hellip;' . '</p>';
    }
    return $content;
}

That worked for me before I enabled the Relevanssi-Plugin > see Screenshot "WithoutRelevanssi". After activating the Plugin, it doesn't show me the titles or some description to most of the links > see Screenshot "WithRelevanssi". What do I miss here?

And another (perhaps) simpler question: When not finding any results, I'm getting a blank page with my "no-results"-sentence from the WordPress-Archive. Why doesn't it fit my template? I checked the fallback from Layouts setting-page. There I checked "what the theme would output". But still there is a white page with this sentence. > See screenshot "noResults".

Thanks for your help in advance!

#441407

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+00:00)

Hi Diana

Firstly, I notice that you are not using the latest versions of the Toolset plugins.

Before proceeding are you able to update them? Do you have a staging site or dev server to test on? If you are updating the live site, please make sure you have a current backup first.

If you could update and then re-test and let me know if you still have problems.

Working with the current versions I was able to set up a test site running twentysixteen and didn't observe any problems with the output (although I didn't get as far as setting it up in Layouts, I'll wait to hear from you before I do.)

#441497
NoResults.JPG

You are right, Nigel: The newest versions did solve my first problem. My archive-content-template works now with the Relevanssi-search-results, as it should. Thanks for that!

Now the only issue I have left is, that I don't know, how to show the no-results-page within my layout. It's strange, some of my layout-sections are shown (like my footer), others are there but without any content (like my header but without my menu) and others are totally gone (like my content with my background-colors.

#441802

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+00:00)

I went ahead and set this up in layouts with a dedicated layout containing a WordPress Archive Cell with my custom search archive which I then assigned to search archives.

I added a little text cell at the top of the layout with dummy text so that I could easily see on the front end when the layout was being used.

I performed a meaningful search that returned results and used the search layout.

I performed a nonsense search with no results returned and it, too, used the search layout and displayed normally, as expected.

Does the above sound in any way different to how you have set up your search results?

Could you try switching to the twentysixteen theme (you will need to add the twentysixteen integration plugin) and testing and see what results you get?

I'll wait to hear back from you.

Le sujet ‘[Fermé] Adding Relevanssi breaks template of results page’ est fermé à de nouvelles réponses.