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

Simon Vart simon.vart at exigences.biz
Wed Oct 23 14:57:35 UTC 2013


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'


-- 
---------------------
Simon Vart
développement web / informatique
----
02.98.67.92.70
06.09.97.82.91
www.exigences.biz
linkedin : http://www.linkedin.com/profile/view?id=87258047
twitter : @simonvart
skype: carantecinfo
---------------------

Le 23/10/2013 14:25, J.D. Grimes a écrit :
> 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)).
>
> -J.D.
>
> On Oct 22, 2013, at 7:23 PM, Micky Hulse <mickyhulse.lists at gmail.com> wrote:
>
>> Hi,
>>
>> Details: Wordpress 3.6.1, iOS WP app 3.8.3.
>>
>> I'm hoping someone can help me figure this one out. I can't seem to
>> find an answer on Google.
>>
>> Scenario:
>>
>> Create/publish post from the WP iOS app that has a featured image
>> (uploaded as "original" size).
>>
>> Problem:
>>
>> Functions that get the post's thumbnail only return original size.
>>
>> What I see:
>>
>> When looking at FTP upload location, all of the image sizes (I've got
>> several custom sizes) are there.
>>
>> When I run:
>>
>> print_r(wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), '300px'));
>>
>> ... I get:
>>
>> Array
>> (
>>     [0] => http://foo.com/blog/files/2013/10/20131022-160759.jpg
>>     [1] => 0
>>     [2] => 0
>>     [3] =>
>> )
>>
>> I'm not sure how to trouble shoot this.
>>
>> At first I thought that maybe the WP app did not obey the custom
>> images sizes ... But they are generated and sitting there in my
>> uploads folder.
>>
>> It's almost like something, image related, isn't getting logged to the
>> database when the WP app makes a post.
>>
>> I'd love some help. I'm hoping it's something I overlooked and is easy
>> to fix. :)
>>
>> Thanks!
>> M
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> 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