Skip Navigation

[Resolved] Split: Highlighting search results text – Relevanssi-generated excerpts – Space issue

This support ticket is created 3 years, 5 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by BillD 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2162793

Hello Minesh,
I did as you suggested and contacted both Relevannsi and Generatepress to see if it was the search tool or theme and after their investigations, we seem to be back where we were yesterday – see their feedback below.

We almost have the solution, but for this strange ###SPACE### which we see in the Toolset custom post search results.
I would be very grateful if you could have another look at this to see if it is a Toolset issue as it is in custom post search.
Your credentials are still active.
Best,
BillD

***

September 7, 2021 at 4:59am
Customer Support - Generatepress
Its not a theme issue, as GP doesn’t know of or interfere with the content.
As the content is being generated by Toolset you should check with them.
***
Mon 06/09/2021 18:08
Customer Support - Relevanssi
Any idea what this is? I would be very grateful for any advice you may
> have or links to solutions so that I can eliminate the ###SPACE###.

Something's adding this, likely replacing spaces with this placeholder in order to keep them in place while doing something, and then not replacing the placeholder with an actual space. It is not Relevanssi, but something else. I'd search your theme functions.php for this to see if it's coming from there.

***
September 6, 2021 at 1:34 pm Toolset
I didnt added any shortcode - I just called it. The shortcode resides in functions.php file of your theme which you already added.
Just one other question: Did you see the 'error' in yellow for one of the highlighted words further down the page?
: ###SPACE###Contract of service
==>
That is not from Toolset, it should be how relevanssi manages space or something. You should check with them.

#2162805

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you disable the shortcode for a moment and then check, does that SPACE issue resolved with you removed the shortcode I shared?

#2162831

Well, I don't know what you did... but it seems to be fine now. The ###SPACE### has gone.
Just so I know did you change something?

#2162839

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - I've adjusted the shortcode as given under:

function highlight_keyword_func($atts, $content) {
    $content = do_shortcode(trim($content));
    if(isset($_GET['wpv_post_search'])){
        $content = relevanssi_highlight_terms(str_replace("###SPACE###"," ",$content), $_GET['wpv_post_search']);
      
     
    }
    return $content;
}
add_shortcode( 'highlight-keyword', 'highlight_keyword_func' );

And the shortcode is moved to "Custom Code" section of Toolset so its easy to edit.
=> hidden link

#2162843

Brilliant! Thank you very much.
Have a good one.

#2162845

My issue is resolved now. Thank you!