php - Wordpress: How to scale large image width? -



php - Wordpress: How to scale large image width? -

the big size images break wordpress theme layout (exceeding width of post). have noticed 20 10 theme scale big size images width nicely (by reducing width , height). want same thing, how can that?

you need add together functions.php

add_theme_support( 'post-thumbnails' );

then utilize smaller image in post like:

the_post_thumbnail().

the default size 50/50, can either alter or add together more sizes:

to alter default size do

set_post_thumbnail_size();

and add together sizes do

add_image_size( $name, $width, $height, $crop );

wordpress automatically creates multiple versions of images in different sizes.

in later versions there 3 sizes, thumbnail, medium , large, beingness created you. utilize these or size added using add_image_size do:

get_the_post_thumbnail($post->id, 'medium'); // utilize medium size, replace medium whatever size.

to utilize thumbnails not insert image post, insert them in theme.

php image wordpress

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -