Change Featured Image Link via functions.php
-
hello,
I hope someone can help me here.
I need to change the featured image link via the functions.php when there is an featured image on the single.php.
I upload the featured image via an frontend form, so no modification in the wordpress backend is possible.
Right now the featured image links to the single post, thats fine but in the single.php it should link to the LARGE image.
I allready changed it in my themes core, but this is a dirty solution 🙁`if( !is_singular() ) {
echo ‘
<a href=”‘ . get_permalink() . ‘” class=”post-thumbnail post-thumbnail-‘ . $position . ‘”>
<img src=”‘ . esc_url($thumbnail_url) . ‘” alt=”‘ . the_title_attribute(‘echo=0’) . ‘” width=”‘ . $thumbnail_width . ‘” height=”‘ . $thumbnail_height . ‘” />
</a>
‘;} else {
echo ‘
<a href=”‘ . $thumbnail[0] . ‘” class=”post-thumbnail post-thumbnail-‘ . $position . ‘”>
<img src=”‘ . esc_url($thumbnail_url) . ‘” alt=”‘ . the_title_attribute(‘echo=0’) . ‘” width=”‘ . $thumbnail_width . ‘” height=”‘ . $thumbnail_height . ‘” />
</a>
‘;}`
can someone help me here, to put this in a function with a hook or something?
thanks for help,
Denis
The topic ‘Change Featured Image Link via functions.php’ is closed to new replies.