Custom Image Sizes/How does picturefill_wp_add_image_size() really work?
-
Love this plugin as stated before, but the documentation leaves me scratching my head. I need to know if
picturefill_wp_add_image_size();
Is needed, and what some of the arguments are all about. When I enable this line of code the images on my page hang and refuse to load just like my problem with the post_thumbnail.
I tried calling this function on its own, as well as after I used the default add_image_size() function, but no success.
Do we need to call the default add_image_size at all or does picturefill_wp_add_image_size() take care of this for us? One thing is for sure using just the default add_image_size does not lead to my images being generated by the plugin.
I thought this might have to do with not yet including a call to
picturefill_wp_set_responsive_image_sizes($image_size_array)
but using the following code I was still met with failure:
if ( function_exists( 'add_image_size' ) ) { add_image_size( 'extra-small', 480 ); add_image_size( 'small', 768); } add_filter( 'image_size_names_choose', 'lc_insert_custom_image_sizes' ); if(defined('PICTUREFILL_WP_VERSION')){ //commented out because not sure if needed //picturefill_wp_add_image_size('small', 768, 0, false, 'medium'); $image_size_array = array('thumbnail', 'extra-small', 'small', 'medium', 'large'); picturefill_wp_set_responsive_image_sizes($image_size_array); apply_picturefill_wp('widget_text'); //apply_picturefill_wp_to_post_thumbnail(); }
So what gives? How do I properly set up my custom sizes? add_image_size? picturefill_wp_add_image_size? and once that all works – how do I get the array pushed into the plugin to make sure its pulling the right images and dimensions?
picturefill_wp_set_responsive_sizes doesn’t seem to want to play nice either. If anyone can help please let me know – getting sick of the whole picturefill topic been working on optimizations so long!
-Zach
- The topic ‘Custom Image Sizes/How does picturefill_wp_add_image_size() really work?’ is closed to new replies.