Add image size
-
I’m not sure what I think I’m doing right is actually right. For now I just want to focus on this line of code. I’m not sure if it’s doing what I think it’s doing.`
<?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,’large’); $image_url = $image_url[0]; ?>`I want to make sure I’m understanding this correctly. This line of code is using the image that is associated with the size large. I want to use a different sized image. So I thought all I had to do was change the word large to an already predetermined size. There wasn’t a predetermined size in my theme that I wanted to use. So I thought I could add image size. In my functions file, there was already a function that looks like this.`
add_theme_support( ‘post-thumbnails’ );
add_image_size( ‘big-category-thumb’, 276, 221, true );
add_image_size( ‘small-category-thumb’, 106, 69, true );
add_image_size( ‘featured-small-thumb’, 67, 48, true );
`
It listed many more add image sizes, but this is just a sample of them. So I thought all I had to do was add to this list. So I added to the bottom of the list:
add_image_size( 'featurecustom', 277, 320, false );I thought all I had to do was then replaced the word large with ‘featurecustom’ and it would use the size associated with featurecustom. But it does nothing. I’m obviously doing something wrong or not understanding something correctly. Is this how you properly add image size?I even downloaded a plug-in to resize all my images after I’ve added an image size, but that didn’t work either.
The topic ‘Add image size’ is closed to new replies.