Skip Navigation

[Resolved] Calling a shortcode

This support ticket is created 3 years, 4 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 2 voices.

Last updated by BillD 3 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#2171949

My recent tickets are all related and haven't really been resolved satisfactorily because they have left me ignorant - I'll take the blame an remain polite, but I would like to know how to do specific things that are not obvious and are not explained in the documentation.
This was one ticket.
https://toolset.com/forums/topic/highlighting-search-results-text-relevanssi-generated-excerpts/page/2/
My question was "Please could you send me a private link to show me where you added the shortcode?" (or just tell me)
Response: "I didnt added any shortcode - I just called it. The shortcode resides in functions.php file of your theme which you already added."
I understand it is the functions.php file, but I want to be able to call it myself so please can you explain how and where because the changeover to blocks makes it difficult to follow you, the documentation and training videos.
Thank you.

#2171959

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

Based on the previous thread it would appear that the shortcode that is being used is.

[highlight-keyword] [/highlight-keyword]

Where it highlights any text being placed inside it in the format below.

[highlight-keyword] [types field='anglais'][/types] [/highlight-keyword]

In the above example the Types shortcode will produce the results from your custom fields.

Generally you can add the shortcodes using the Gutenburg editor in 2 ways:

1. You can use any WYSIWYG editor and add the shortcodes in the format

[highlight-keyword] Any Text/Shortcode goes here[/highlight-keyword]

2. You can use the gutenburg shortcode block and then add the shortcodes similarly to the above.

Now in your case you should be able to wrap the highlight keyword shortcode around any types shortcode.

Please let me know if this is a little clearer for you.

Thanks,
Shane

#2171973

Hello,
Thank you for your reply. It's clear.

I'm sure I'm missing something, but I can't see where it goes.
Any pointers?
THanks.
Bill

#2171981

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bill,

You're using a header block and wanted to highlight the heading ?

If you provide me with admin access I should be able to see the issue more clearly and provide instructions on how you can resolve this.

I've enabled the private fields for your next response.

Thanks,
Shane

#2172037

Sorry I forgot to add that you can try searching for "Contract" for example for the 1st dynamic field as an example.

#2172061

Should be ok now. let me know if not.

#2172235

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bill,

Take a look at my screenshot. I've searched for Contract, so now you want the heading "français" to be highlighted correct?

Please let me know.
Thanks,
Shane

#2172551

Hi Shane,
Please hide this conversation:
In the screen shot the titles in blue francais & anglais are just labels.
It is the two Dynamic Heading Text below each of them which show Contrat & Contract here.
In these Headings a word that is searched for in the search field should be shown as highlighted in yellow.
If you go to dashboard and search for "contract" in Admin search you will see what I mean as it highlights the fields there.
Thanks.
Bill

#2174105

Hi Shane,
Totally understand the delay.
You should have access now.
Please let me know if there is anything else.
Bill

#2174161

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bill,

I understand the issue a little better now.

Essentially how this shortcode is suppose to work is that you will need to wrap your entire content inside it for the highlight to work.

This is feasible using the block builder for the archives however you will need to do your entire content in the classic editor block and do your entire design in that block by wrapping the content with the highlight shortcode.

[highlight-keyword]  

Entire Content 

[/highlight-keyword]


Essentially you will need to replace all your content inside the container block with just 1 classic editor block and inside that block you will need to re-add your content using the fields and views button.

If you're not sure of what i'm referring to I can setup a small sample for you in the archive but you will need to re-add the rest of your missing content.

Thanks,
Shane

#2174173

Hello Shane,
Glad you can see what is going on.
That sounds like a solution to the problem I gave you, but the initial solution isn't perhaps what I'm looking for then and I'm not going to redo everything again as I have already lost the work twice before (See view not found ticket) and this could not be resolved.

If it is ok with you, I would like to look at this again from a different angle.
NB please could you delete or make the screenshot & two replies #2171973& #2172551 private.

Would you like me to close this ticket and start another one as I am going to change the subject?
Thanks.
Bill

#2174275

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bill,

I must apologise for not being able to fully assist on this one.

Also yes please go ahead and close this ticket and open a new one.

Finally I'll go ahead and remove the screenshots and remove the responses as well.

Thanks,
Shane

#2174397

My issue is ongoing, but this option has been clarified.