我可以这样手动操作:
echo get_the_post_thumbnail($post->ID, \'large\');
但是如何设置the_content();
太大了?我可以这样手动操作:
echo get_the_post_thumbnail($post->ID, \'large\');
但是如何设置the_content();
太大了?您可以使用$content\\u width设置添加到帖子的图像的最大宽度。您也可以将其用于高度。
如果使用CSS,较小的贴子图像可能会被拉伸。出于某种原因,我找不到任何好的方法来将帖子图像链接到帖子。我在上找到一个脚本http://wpguy.com/plugins/linked-image/ 它可以工作,但不会删除旧链接,而是将旧链接和图像包装在新的a标记中。我想要的是删除旧链接,这样图像只包装在一个a标记中。这是我目前拥有的脚本:function wpguy_linked_image($content){ $searchfor = \'/(<img[^>]*\\/>)/\'; $r