Make images link to medium or large size — not full - Wordpress Solution
[Solved] - Make images link to medium or large size — not full - Wordpress Solution |
---|
Try following codes |
Alright, this has been bugging me for quite a while, and I've yet to find a decent answer that doesn't involves tearing up WordPress' core files.
How do I make images that are inserted into a post link to the medium or large version, and not the full size?
I see two possible solutions — but I'm not clever enough to hack together a plugin.
1) Create a new button under Link URL in the Media/Gallery section that says "Large Size"
2) Filter the function that outputs images in posts to show the medium/large version instead of the full size
Other suggestions and solutions are of course just as welcome.
Thanks!
Solution - 1insert this code to functions.php of your theme. added screnshot Solution - 2You can made it via CSS file. Look at HTML codes and find your links CLASS, for example: My site Our class is largelink, find it at your CSS and replase how you want. If you need more help please contact with me. Solution - 3Not sure what your use is for this but you could just insert a post thumbnail for the post: [[LINK href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/"]]http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/[[/LINK]] The issue is if you need this to change from large to medium to small size this may be difficult. Often times i have wordpress spit out both images and have jquery hide one or the other thumbnail based on the template. This could also allow you to (further down the line) to build something more complicated. Does that help? |
Date: 2022-10-21 05:22:07 |
Category: Wordpress |