[wp-hackers] iOS WP app: Featured image size problems

Nicholas Ciske nl at thoughtrefinery.com
Thu Oct 24 12:06:07 UTC 2013


Not a true solution, but a viable workaround: you could install WP Thumb which will create missing image sizes on the fly (and then cache them for future use).

http://wordpress.org/plugins/wp-thumb/

_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske	

On Oct 23, 2013, at 1:58 PM, Micky Hulse wrote:

> Hello,
> 
> Thanks so much for the replies J.D. and Simon, I really appreciate your help.
> 
> On Wed, Oct 23, 2013 at 5:25 AM, J.D. Grimes <jdg at codesymphony.co> wrote:
>> I don't think that wp_get_attachment_image_src() accepts parameters of the format you are using ('300px'). http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src
>> The $size can either be a keyword (thumbnail, medium, large or full) or an array (array(300,300)).
> 
> My bad. I apologize that I did not mention the rest of my setup.
> 
> In my functions file, I have:
> 
> function mytheme_setup() {
> add_theme_support('post-thumbnails');
> set_post_thumbnail_size(150, 150);
> }
> add_action('after_setup_theme', 'mytheme_setup');
> // ... and later on in this file:
> # Add new image sizes:
> add_image_size('130px', 130); // Thumbnail size: 130 x 130
> add_image_size('300px', 300); // Medium size: 300 x 300
> add_image_size('470px', 470);
> add_image_size('640px', 640);
> add_image_size('810px', 810);
> add_image_size('980px', 980); // Large size: 980 x 980
> add_image_size('1320px', 1320);
> add_image_size('1620px', 1620);
> add_image_size('1960px', 1960);
> 
> The new image size names are based on another system we use ... I
> wanted to keep the "XXXpx" naming conventions the same across systems.
> 
> With that said, the use of (for example):
> 
> wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '300px')
> wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '640px')
> 
> ... work for all images, except for images uploaded as a featured
> image using the WP iOS app.
> 
> Other image getting functions also work, but it's the iOS images that
> just return the original source image size.
> 
> On Wed, Oct 23, 2013 at 7:57 AM, Simon Vart <simon.vart at exigences.biz> wrote:
>> I think you could also add a new image size in functions.php :
>> add_image_size( '300px', 300, 300, true );
>> and then your call to wp_get_attachment_image_src() will be understood. When
>> you upload an image, WP will create a image of this size with the keyword
>> '300px'
> 
> Sorry again, that I did not detail my setup. Thank you for the help,
> and thankfully I do have that setup in my functions.php file. I
> should've made that clear in my first message. :(
> 
> Question(s):
> 
> When you folks use the iOS WP app, and set a featured image, are you
> able to get at the different sizes on your templates?
> 
> For some reason, my setup isn't allowing me to access the custom image
> sizes (only for iOS-uploaded featured images), even though they are
> generated and sitting there in my uploads folder.
> 
> Maybe I'm not setup properly in my functions.php file? I have all of
> my add_image_size() calls just sitting out in the open. Do I need to
> have these inside of an action? Should they go inside the
> "after_setup_theme" action along side my
> add_theme_support('post-thumbnails') call?
> 
> Please let me know if I can provide more information.
> 
> Thank you!
> 
> M
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list