link a shortcode block
-
On this website you see a few badges who are displayed with a shortcode. is it possible to allow users to click on this badge and link them somewhere else on the website?
The page I need help with: [log in to see the link]
-
Hi @gtogan1 – the simplest way to achieve your goal is to insert images using the Image block and adding a link to the block.
https://ww.wp.xz.cn/support/article/image-block/#link-settings
If you’re asking specifically about how to modify the badge shortcode being used on that page, you’d need to ask the developers of the badge shortcode if there is a shortcode parameter available for a link, as each shortcode is different, depending on how it’s been coded by the developer.
hello kathryn. i don’t really think there needs to be something done about the shortcode. I’m just simply asking how i can add a link to the shortcode. So after people click on a badge, they will be linked to another page. Is there not a link option here?: https://drive.google.com/file/d/1-FP667V5G5jzntUbkP_z-yNutyqsWYCT/view?usp=share_link
Let me try to explain it a different way:
A shortcode is a piece of code that can take various parameters. For example, one parameter in your shortcode example is “tid.” The meaning of “tid” and what it does on the front end is defined entirely by the developers who created your shortcode.
To add extra functionality like a link to a shortcode, it needs to have been programmed inside the shortcode itself, by the developers. As I’m not familiar with your shortcode I can’t tell you whether or not it comes with a URL or link parameter, so you’ll need to ask the developers as they’re best placed to help you. There’s no “generic” parameter you can add to a shortcode to do something like add a link or anything else.
I hope this helps explain things better.
I see… i saw that there are multiple options with the gutenberg editor how you can link things. Is there a creative way i could use the editor for example to put the shortcode in a box or something else and then redirect users somewhere else?
One thing you could test is using a Custom HTML block and inside the block, put your shortcode, wrapped in an HTML link. May not work but perhaps worth a try. π
What plugin are you using for your shortcode?
The plugin i’m using for the badges is called ”WP reviews slider pro”
Great β I’d definitely suggest asking the plugin developers directly if there’s a way to add a link, they must have been asked before. π
Yes, i was already talking with them about it but they too couldn’t come up with a solution for me. But i gave it a try with the wrapped html link that you suggested, and it worked! i found a code on the internet and pasted it on my website but there is only one small problem: The numbers and letters are underlined. do you know why that is?: https://drive.google.com/file/d/1hHcQOxrWnJ9FabM0W0ul_TE0EtvdeBfA/view?usp=share_link
https://drive.google.com/file/d/1IuIS54a-LApOhu8UcS_CPjwrbvhXsPyp/view?usp=share_link-
This reply was modified 3 years, 6 months ago by
gtogan1.
But i gave it a try with the wrapped html link that you suggested, and it worked!
Great!
there is only one small problem: The numbers and letters are underlined. do you know why that is?
Your theme may be defining links as having underlines, unless more specific CSS overrides that style, so could add some custom CSS to remove the underlines on links within your badges.
I’ll mark this thread as resolved but feel free to start a new one if you have other questions relating to the block editor. Cheers!
-
This reply was modified 3 years, 6 months ago by
The topic ‘link a shortcode block’ is closed to new replies.