用于add_image_size()
你的functions.php
:
<?php add_image_size( $name, $width, $height, $crop ); ?>
add_image_size( 'your-image', 150);
Run Code Online (Sandbox Code Playgroud)
...然后在模板中使用它:
<?php the_post_thumbnail('your-image'); ?>
Run Code Online (Sandbox Code Playgroud)
参考:http://codex.wordpress.org/Function_Reference/add_image_size
您网站的一些变化 css
尝试添加 height:250px; //example you can whatever you want. ...
在你的
.avia-content-slider .slide-image, .avia-content-slider .slide-image img
Run Code Online (Sandbox Code Playgroud)
我有截图给你
并看看..
请在主题的function.php文件中添加以下代码
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'custom-image-thumb', 200, 200,true ); //200 pixels wide and 200 height, true for crop exact size and false for dimensional crop.
}
Run Code Online (Sandbox Code Playgroud)
然后你可以像下面的代码一样在前端使用它:
<?php echo $image = get_the_post_thumbnail($post_id, 'custom-image-thumb'); ?>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6546 次 |
最近记录: |