I'm wondering if it is possible to use different image sizes (medium, large) for the content on the homepage and single post pages. I have a narrow column on the homepage than on the single post pages and different image sizes would be nice.
Thanks.
|
I'm wondering if it is possible to use different image sizes (medium, large) for the content on the homepage and single post pages. I have a narrow column on the homepage than on the single post pages and different image sizes would be nice. Thanks. |
|||
|
|
|
If your talking about the images that are written into $post->post_content (the_content()) you'll either need to write a filter that strips out all images and replaces them with the smaller version. Or you could just use CSS. For CSS make sure you have body_class() in your body tag then you can localise a maxwidth to your home page.
|
|||
|
|
If you're using the
See the Template Hierarchy and |
|||
|
|
|
|||
|
|
|
If you are using featured images you could use the following inside your loop.
Where If you are using the attached images you could use the following functions.
The first one gives you the img tag while the second one gives you an array containing image source, width and height. You can use this function if you know the id of the attachment. To create extra image sizes when you upload an image you can use the |
|||||||||
|