简体   繁体   English

如何在Wordpress帖子中添加自定义图像尺寸的链接?

[英]How to add links of a custom image sizes in wordpress post?

I am using add_image_size() function to add custom image sizes in wordpress and want to show downloadable link of any image size in single post. 我正在使用add_image_size()函数在wordpress中添加自定义图像大小,并希望在单个帖子中显示任何图像大小的可下载链接。 If you don't understand what I want to say please take a look at the following website. 如果您不明白我要说的话,请访问以下网站。

http://www.alliphonewallpapers.com/iphone-wallpaper/id/3238/ http://www.alliphonewallpapers.com/iphone-wallpaper/id/3238/

It save images in different sizes and add link of that size in its post. 它保存不同大小的图像,并在其帖子中添加该大小的链接。 I also want to add links of different image size. 我也想添加不同图像尺寸的链接。 Please help me. 请帮我。

Well, you need to obtain thumbnail URL. 好吧,您需要获取缩略图URL。 Look at Wordpress Codex, there is an example that perfectly fits your needs and it even shows given URL only if given thumbnail size is available: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Post_Thumbnail_Linking_to_large_Image_Size 看一下Wordpress Codex,有一个完全符合您需求的示例,并且仅在给定缩略图大小可用时,它甚至显示给定URL: http : //codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Post_Thumbnail_Linking_to_large_Image_Size

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM