Support » Plugin: Picturefill.WP » apply_picturefill_wp_to_post_thumbnail() issues

  • Resolved Zach Atkinson

    (@z_atk)


    Hi there,

    Simply smashing plugin and I have it configured no problem to work properly on my widgets thanks to the extensions, however when trying to call this function:

    apply_picturefill_wp_to_post_thumbnail()

    page hangs and nothing appears where featured images should be. Full code as follows:

    function upbootwp_scripts() {
    	wp_enqueue_style( 'upbootwp-css', get_template_directory_uri().'/css/bootstrap.css', array(), '5.0.5');
    	wp_enqueue_script( 'upbootwp-jQuery', get_template_directory_uri().'/js/jquery.js',array(),'2.0.3',true);
    	wp_enqueue_script( 'upbootwp-basefile', get_template_directory_uri().'/js/bootstrap.min.js',array(),'1.1',true);
        if(defined('PICTUREFILL_WP_VERSION')){
            apply_picturefill_wp('widget_text');
            //apply_picturefill_wp_to_post_thumbnail();
    
        }
    }

    Note I have commented out the offending code for now. site for reference is http://zachatkinson.com

    https://wordpress.org/plugins/picturefillwp/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author kylereicks

    (@kylereicks)

    Hi Zach, thanks for taking the time to post the issue. After working through a few other bugs noticed by others, I am not able to duplicate the behavior you describe, so it is possible that one of these bugs was the cause of our trouble. I pushed these bug fixes a few minutes ago with version 1.3.4. If you’re willing, give it another try with the latest version and see if the problem persists. If it does, I’ll do some more investigating and try to duplicate the issue.

    Thanks again for the feedback.

    Thread Starter Zach Atkinson

    (@z_atk)

    Hi Kyle I’m still getting a hang with this function enabled but I think I know why – I need to create a picturefill-wp-add-image-size(‘post-thumbnail’ …) correct? Right now I don’t have a post thumbnail image class (As I figured no need to add an extra class which will result in more image generation then I need).

    I am about to attempt adding a new image size “post-thumbnail” to see how the plugin reacts. I assume this will solve my issue, but will this not also generate images that size for every image in my site?

    Can I leave this size out of picturefill_wp_set_responsive_image_sizes and be confident thee new sizes will only be applied to featured images?

    Simple questions I know, but any help would be appreciated. I hope I have been clear!

    Thanks again,

    -Zach

    Thread Starter Zach Atkinson

    (@z_atk)

    Hi Kyle,

    Reporting back – I re-enabled the function and looked for where I had called

    add_theme_support( ‘post-thumbnails’ );

    and noticed I hadn’t included set_post_thumbnail_size( x, y); anywhere! This must have been the root of the plugin hanging, it kept trying to regenerate the images each page load because it was being passed size values of 0!

    If I could suggest something else for the documentation, it would be including a note discussing this briefly. Maybe with this snippet:

    add_theme_support( ‘post-thumbnails’ );
    set_post_thumbnail_size( 1920, 1080 );

    obviously changing the sizes to whatever the user wants. Once I did this and enabled post-thumbnail code everything was flying like a rocket ship. Consider me a happy camper – I hope 2.0 is this easy to set up.

    Thread Starter Zach Atkinson

    (@z_atk)

    Marking as resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘apply_picturefill_wp_to_post_thumbnail() issues’ is closed to new replies.