Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在wordpress中更改所有帖子中标题图像的大小_Javascript_Php_Html_Css_Wordpress - Fatal编程技术网

Javascript 在wordpress中更改所有帖子中标题图像的大小

Javascript 在wordpress中更改所有帖子中标题图像的大小,javascript,php,html,css,wordpress,Javascript,Php,Html,Css,Wordpress,我在更改每篇文章中看到的firts图像的大小时遇到问题,我该怎么做?我使用的是WordPress主题,Tortuga1。 我想更改我已经拥有的所有帖子中所有标题图像的大小我知道您正在使用类似的图片: echo get_the_post_thumbnail( $post_id, 'large', array( 'class' => 'alignleft' ) ); 现在试试这个: the_post_thumbnail( 'large','style=max-width:100%;heigh

我在更改每篇文章中看到的firts图像的大小时遇到问题,我该怎么做?我使用的是WordPress主题,Tortuga1。
我想更改我已经拥有的所有帖子中所有标题图像的大小

我知道您正在使用类似的图片:

echo get_the_post_thumbnail( $post_id, 'large', array( 'class' => 'alignleft' ) );
现在试试这个:

the_post_thumbnail( 'large','style=max-width:100%;height:auto;');
如您所见,CSS用于操纵图像的大小。 请记住,使用正确大小的附件缩略图(中、大、满)来显示正确的图像密度。此函数不需要echo


*如果主题支持srcset属性,则此方法无效。

欢迎使用堆栈溢出!寻求代码帮助的问题必须包括在问题本身中重现代码所需的最短代码,最好是以最短的代码。看见