Archived topic
Can I stop a featured image acting as a link?
11 replies · Started by Hakim on August 18, 2018
I have a published post whose tile on the home page has three elements: the post title, a featured image, and an excerpt which is coded as a link to an external site.
Selecting the title or the excerpt takes me to the external site in a new tab which is the desired behaviour.
However selecting the featured image takes me to the post which only has a link to the external site which then functions as above.
Is is possible to change the behaviour of the image to either do nothing when selected or, ideally, to have the same behaviour as the other two elements?
The site is https://inayatiorderaustralia.org/ and the post is "Sufis: Islam’s musical mystics".
With thanks,
Hakim
Hi there,
if it is just that single post you want to apply it to you could simply do this:
#post-1280 .inside-article .post-image {
pointer-events: none;
}
Thanks David but this doesn't seem to do anything.
Have copied and pasted code into the Simple CSS box and updated the post, flushed cache, exited and reloaded the browser and all is the same.
The post format was set as a link - changed that back to standard and that just lost the title functioning as a link so the post has been returned to link.
Any suggestions?
Hakim
Can you add the CSS back in so i can see why it isn't working. And try placing it above any other CSS you may have in there.
Hi David,
I didn't remove the css.
The only css on the post is the copied and pasted:
#post-1280 .inside-article .post-image {
pointer-events: none;
}
In Appearance -> Simple css is:
h2.entry-title {
text-align: center;
}
Thank you for your interest in this.
Hakim
Hi there,
can you add the code to the Appearance > Simple CSS instead of to the actual post.
Yes, that works.
The ideal solution would be if the featured image could be configured to use the link the title above and the link below which go directly to the desired remote site.
For selecting the featured image to do nothing is probably worse than taking visitors to the page and selecting the link manually.
Thanks David. I will mark it as resolved. I got the solution I asked for but it turns out not to be what I actually want :(
All best wishes and thanks for your input.
Hakim
You're welcome.
If you want to share the current code you have for the redirect we could look at expanding that so all the links are covered. Let me know.
Oh ok, so you may want to look at this plugin especially if you may want to add more external posts:
https://wordpress.org/plugins/page-links-to/
It makes the process easier than targeting them individually. Let me know.
Thanks David, I will check out the plugin.
Much appreciated input from you.
Hakim
You're welcome :)