AI助手支持GPT4.0
Custom Image Sizes is a WordPress plugin that
自定义图像大小是一个WordPress插件, p>
'[width]x[height]'
'[width] x [height]' code>的自定义尺寸。 li>
ul>
Read more at the Custom Image Sizes page.
在自定义图像尺寸页面上了解更多。 p>
p>
>
add_image_size( 'my_custom_thumbnail_name', 220, 130, true );
add_image_size('my_custom_thumbnail_name',220,130,true); code>放入主题的functions.php文件中。 li>Add the code to display that attachment’s thumbnail where you want it to appear: echo wp_get_attachment_image($attachment_id, 'my_custom_thumbnail_name');添加代码以将附件的缩略图显示在您希望显示的位置: echo wp_get_attachment_image($ attachment_id,'my_custom_thumbnail_name'); code> li>Unlike WordPress by itself, Custom Image Sizes will generate the thumbnail for an image, even if the image was uploaded before this add_image_size() was set.与WordPress本身不同,即使在设置 add_image_size() code>之前上传图片,“自定义图片大小”也会生成图片的缩略图。 li>
echo wp_get_attachment_image($attachment_id, 'my_custom_thumbnail_name');
echo wp_get_attachment_image($ attachment_id,'my_custom_thumbnail_name'); code> li>Unlike WordPress by itself, Custom Image Sizes will generate the thumbnail for an image, even if the image was uploaded before this add_image_size() was set.与WordPress本身不同,即使在设置 add_image_size() code>之前上传图片,“自定义图片大小”也会生成图片的缩略图。 li>
add_image_size()
add_image_size() code>之前上传图片,“自定义图片大小”也会生成图片的缩略图。 li>
Call wp_get_attachment_image_src() or wp_get_attachment_image() with the desired thumbnail '[width]x[height]' dimensions, like so:
wp_get_attachment_image_src()
wp_get_attachment_image()
用所需的缩略图'[width] x [height]' code>尺寸调用 wp_get_attachment_image_src() code>或 wp_get_attachment_image() code>,如下所示: p> echo wp_get_attachment_image($attachment_id, '220x80'); echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* / code> pre>
'[width] x [height]' code>尺寸调用 wp_get_attachment_image_src() code>或 wp_get_attachment_image() code>,如下所示: p> echo wp_get_attachment_image($attachment_id, '220x80'); echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* / code> pre>
wp_get_attachment_image_src() code>或 wp_get_attachment_image() code>,如下所示: p> echo wp_get_attachment_image($attachment_id, '220x80'); echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* / code> pre>
wp_get_attachment_image() code>,如下所示: p> echo wp_get_attachment_image($attachment_id, '220x80'); echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* / code> pre>
echo wp_get_attachment_image($attachment_id, '220x80'); echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* / code> pre>
echo wp_get_attachment_image($ attachment_id,'220x80'); /** / ** * The above prints markup like *以上打印标记 * * * class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" /> * class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” /> */* /
/**
/ **
* The above prints markup like
*以上打印标记
*
* class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" />
* class =“ attachment-220x80” src =“ http://www.example.com/path-to-file/something-220x80.jpg” />
*/
* /
code> pre>
li>
filosofo-custom-image-sizes/
/wp-content/plugins/
filosofo-custom-image-sizes / code>上载到 / wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>
/ wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>
ol>
原文出处:http://www.sanshu.cn/a/9584.html
群主管理都是支付大佬