• Hi Mikko,

    I’m using the Sydney Pro theme with Relevanssi. Searching works, results page is fine with highlighted search terms, but the result links don’t have the “highlight” attribute added – so no highlighting on the following page. If I add it manually in the URL of my browser (…/?highlight=term) highlighting works.

    If you need it, the search.php files is here: https://pastebin.com/1Z5zvUim

    Can you help?

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

    (@msaari)

    I tried the free version of Sydney and it added the highlight parameter without problems when I checked the “Highlight query terms in documents” option. At least in the free version there’s nothing that stops this from working. The Pro version may be different. Can you please show me the content-search.php file, that’s the critical one?

    Thread Starter cmunk

    (@cmunk)

    Thank you for your quick reply.

    I have pasted the content-search.php file here: https://pastebin.com/XxbcBKDB

    Plugin Author Mikko Saari

    (@msaari)

    That’s exactly the same as in the free version of Sydney that works on my test site.

    Try one of the WP default themes. You don’t have to switch the theme, just live preview it and do a search. Does the highlight parameter appear with the default theme? If it does, the problem is in the theme, but if it doesn’t, it’s somewhere else.

    You have the “Highlight query terms in documents” setting checked, right?

    Thread Starter cmunk

    (@cmunk)

    Now, suddenly, it works. Or, I don’t know… I tried previewing themes, they all worked. Then I tried my own theme again, and highlighting now works – and I don’t know why (I’m working on the site now, so maybe I made a change somewhere that made a difference). But it’s not the highlight parameter that’s added to the URL, it’s ?s=term. Is that still Relevanssi? The results look like it is, but I am admittedly a bit confused.

    Secondly, I’ve purchased your premium version to index PDFs. The PDFs are embedded, in this case with PDF-embedder, so I followed your explanation about adding code to functions.php. Indexing and searching works, but highlighting in the PDF document doesn’t, which I’m not really surprised about (as it’s a separate viewer). Also, the PDF’s content is not shown in the search results (and therefore no highlighting there either),
    So this second question is then: Do you know of a way, a plugin or something, to make highlighting work with embedded PDFs?

    Plugin Author Mikko Saari

    (@msaari)

    Since you’re a Premium customer now, drop me a note on the Premium support form with a link to your site, and I’ll take a look at it.

    I don’t think there’s a PDF embedder that could show highlights inside the PDF content, but checking the “Use custom field content for building excerpts” option on the Relevanssi excerpts and highlights tab should get you PDF content on the search results page – but the embedder may cause problems here as well. But that’s also something we can take a closer look at in private.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Highlight attribute missing in results links’ is closed to new replies.