How to make a featured Image NOT clickable?

ths1973

Free Member
Sep 2, 2012
55
1
UK
Hi All

we have two areas on our site that have a "featured image" (Poll and Quiz) ... both of these are for some reason clickable on the website; but they should not be.

We know how to unlink an inserted image so that it's not clickable, but we can't figure out how to do the same for a "featured image".

Any guidance/advice/instructions would be appreciated :)
thanks
 
It's a theme thing. Go to your theme editor and find single.php.

Change the thumbnail code to:

Code:
<?php if ( has_post_thumbnail()) : ?>

    <?php the_post_thumbnail('post-image'); ?>

<?php endif; ?>
 
  • Like
Reactions: ths1973
Upvote 0
As fisicx said, its a theme specific thing.

Some themes will even have this as a theme option to turn on or of, so read through all the theme options carefully.

If not, the best way is to modify your theme, but don't forget the featured image may be presented in many places, single posts, pages, search results, archives, so depending on your theme you may have to modify several files. If you are going to modify your theme code, then be sure to create a child theme. see http://codex.wordpress.org/Child_Themes

An alternative if your theme allows you to add in javascript (or you have a plugin that does)
you could do it with a simple bit of jquery e.g.
HTML:
<script>
jQuery(function($){
$('featuredimageselector a').attr("href", "#");
});
</script>
where the 'featuredimageselector a' is of course changed to match your theme's specific html markup.
 
  • Like
Reactions: ths1973 and fisicx
Upvote 0
As fisicx said, its a theme specific thing.

Some themes will even have this as a theme option to turn on or of, so read through all the theme options carefully.

If not, the best way is to modify your theme, but don't forget the featured image may be presented in many places, single posts, pages, search results, archives, so depending on your theme you may have to modify several files. If you are going to modify your theme code, then be sure to create a child theme.

An alternative if your theme allows you to add in javascript (or you have a plugin that does)
you could do it with a simple bit of jquery e.g.
HTML:
<script>
jQuery(function($){
$('featuredimageselector a').attr("href", "#");
});
</script>
where the 'featuredimageselector a' is of course changed to match your theme's specific html markup.

this is a really hacky way of doing it, and you probs dont need the ondoc load function.

The best way to fix this is issue is using php, and modifying the code.
 
  • Like
Reactions: ths1973
Upvote 0

Latest Articles