Support » Plugin: iThoughts Tooltip Glossary » Tooltip glossary trigger term not showing in search results

  • Resolved handwovenbox

    (@handwovenbox)


    Great plugin, Gerkin. Thanks for your hard work.

    The issue I’m experiencing is this: upon creating a glossary term and then adding the tooltip shortcode on another page (or within another glossary term), the tooltip works fine.

    But, when I use the WordPress search function and look through the results, the excerpt from each piece of content is completely missing the text that triggers the tooltip. (The trigger term has gone blank, while surrounding text is still there.)

    Now, when I click on each search result and view the content itself, the tooltip works as expected again. It’s only when viewing the excerpts of each search result that the trigger text is completely missing.

    I tried deactivating all other plugins but the problem persists. Is this a problem other people are experiencing? Thank you in advance for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Gerkin

    (@gerkin)

    Hi,

    I’m not sure to understand your problem, but for what I think I’ve understood, it makes me think about this article I wrote almost 2 years before….. Not sure this is what you are explaining, so don’t hesitate to re-explain your problem.

    The regex array in the article may be a bit outdated. Try this out, and if it does not work, then I’ll fix. I don’t want to fix it now: I’m working on updates that may change this regex when published.

    Anyway, this is not really a problem related with iThoughts Tooltip Glossary; more a problem from WordPress strip_shortcode applied on post excerpts. If you agree, please change the ticket status accordingly.

    Have a wonderful day, cheers 🙂

    Thread Starter handwovenbox

    (@handwovenbox)

    Yes, the shortcodes being stripped from the excerpts was the problem. Thanks for posting the solution–this worked.

    Just a quick note–when I tried to visit your linked article, I got the error
    This site can’t be reached
    www.gerkindevelopment.net refused to connect.

    I was able to view a cached version from Google but I thought you would want to know.

    Plugin Author Gerkin

    (@gerkin)

    Yep, thank you, I’m already aware of the problem, I did something stupid on my server and…. Being silly sucks.

    Thread Starter handwovenbox

    (@handwovenbox)

    I thought I would revisit this thread one more time to post a different solution that may work better than the linked one. In testing my wordpress after following Gerkin’s linked article, I realized that for other types of content, no excerpt was being created at all.

    I found the working solution halfway down this page: https://wordpress.stackexchange.com/questions/42743/the-excerpt-and-shortcodes

    The code is:

    add_filter('the_excerpt', 'do_shortcode');
    remove_filter('get_the_excerpt', 'wp_trim_excerpt', 10);
    add_filter('get_the_excerpt', 'my_custom_wp_trim_excerpt', 99, 1);
    function my_custom_wp_trim_excerpt($text) {
        if(''==$text) {
            $text= preg_replace('/\s/', ' ', wp_strip_all_tags(get_the_content('')));
            $text= explode(' ', $text, 56);
            array_pop($text);
            $text= implode(' ', $text);
        }
        return $text;
    } 

    I inserted this code into the theme’s functions.php file and now shortcodes are shown and executed everywhere they should be.

    Plugin Author Gerkin

    (@gerkin)

    Yep, the solution on my site does not execute shortcodes: it only keeps text (it was the behavior I wanted when I wrote this sample). Both solutions have a different result: choose the one you prefer 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Tooltip glossary trigger term not showing in search results’ is closed to new replies.