Creating your own image size on Wordpress

CATEGORY : Blog | Image Size | Wordpress | Wordpress Tutorial |

Creating your own image size in WordPress is really simple. You can add the code to the functions.php of my previous tutorial which is Creating word press from scratch.

Under the functions.php

Now we would setup the image name and size of our image so WordPress would know what would be the size and how to call our image.

add_image_size( 'ownimagesize', 960, 489, true );

ownimagesize would be the name of the image that you would call on your loop when displaying. 960 would be the image width and 489 would be the height of the image.  This 3 parts can be change depending on your needs.

loop.php or any part where you want to call your own image size.

Below code is how to display your image, you would see that i called “ownimagesize” because that is the name of our image on our functions.php

wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),  'ownimagesize')

4 Responses to “Creating your own image size on WordPress”

  1. zwyrodnienie stawu skokowego says:

    Hey very nice website!! Man .. Beautiful .. Amazing .. I will bookmark your website and take the feeds also…I’m happy to find so many useful info here in the post, we need develop more techniques in this regard, thanks for sharing. . . . . .

  2. skręcenie kostki leczenie says:

    Hey I just finished reading the post. I comment to say that I liked it good job and keep it up man! See ya

  3. choroby stopy says:

    I like this website very much, Its a very nice office to read and get information.

  4. Delta says:

    Came to your web blog through Stumbleupon. You already know I will be subscribing to your rss feed.

Leave a Reply

Old School

Hi! Romeo is Web Developer for 7 years now.Currently i focused more on CMS based projects most of the time Wordpress and its different premium templates like Genesis and Thesis.

I love travelling during Saturdays and Sundays when got no works to removed stress when mondays come to start working again.

Upcomming Contents

  • Creating wordpress widget
  • Creating wordpress plugin
  • Jquery and Wordpress
Footer Logo
2008-2011 Morning Codes. All rights Reserved