images - How do I link a featured photo to it's post?

admin2025-06-03  3

I cannot change the url of the photo in the featured-image edit section. The page can be found at / and if you click on the picture you will see that it just opens the picture.

I cannot change the url of the photo in the featured-image edit section. The page can be found at https://irregularus/tips-and-stories/ and if you click on the picture you will see that it just opens the picture.

Share Improve this question asked Feb 19, 2019 at 6:27 Dylan FlanneryDylan Flannery 1 1
  • You will need to override the post template (template-tags.php in your case) in child theme or you can use wp_get_attachment_image_src filter to override the url – Aparna_29 Commented Feb 19, 2019 at 9:42
Add a comment  | 

1 Answer 1

Reset to default 1

Use

<?php the_permalink(); ?>

to get the link to the current post. Essentially replace whatever the href property of the image link is right now so it looks similar to :

<a class="post-thumbnail" href="<?php the_permalink(); ?>" >
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748890135a314572.html

最新回复(0)