We're merging with GenerateBlocks! Learn more here.

[Resolved] Images not loading in live site if image size is set

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Images not loading in live site if image size is set

  • This topic has 9 replies, 2 voices, and was last updated 4 years ago by Tom.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #11124
    Linda
    Participant

    I have tried following the info in this post, I have resized thumbnails, etc. but it still will not show images on the ‘live’ site, although it does show in view page preview. If I take all image values off of Show Posts, the images do appear, but they are too big for the page that I am trying to use Show Posts on. Any suggestions?

    #11125
    Linda
    Participant
    #11159
    Linda
    Participant

    All I can tell is that inspect on the page tells me img src is blank if I input a size in WP Show Posts, if I leave it blank there, then it finds the file ok. Driving me crazy! Any help appreciated. I bought the pro version, my license is: 7ff6a8972d0361c9c33f4c6bbb9f8b41`

    #11160
    Linda
    Participant

    okay… newbie here, very confused.
    I do not have a live site yet, I am using localbyflywheel, and ngrok.io to host a temp ‘live’ site that I’m using for testing.
    I just discovered, that if I use the ‘view site’ option from admin panel, it takes me to: http://gsdoc.local/blog/ (my local version), and everything looks good! If I use the ngrok url (changes every time I set it up, right now it’s http://28044e5c.ngrok.io/blog), then I get the image source unable to be found IF I SET THE SIZE OPTION IN WP SHOW POSTS. If I don’t set the size option, then it can find the ngrok source file.
    So I guess I can use this workaround for testing, but wanted to report it.

    #11186
    Tom
    Keymaster

    Hi there,

    Sorry for not getting back to you sooner!

    The image resizer only works if URL of the images matches the URL of the actual site. In this case, it sounds like ngrok is confusing the image resizer.

    If you need it to work using ngrok, ditching the image resizing options and doing something like this might help: https://wpshowposts.com/support/topic/show-posts-images-not-working/#post-8324

    #11208
    Linda
    Participant

    I tried following those steps before, but I couldn’t get it working, didn’t see any changes. But there’s a strong possibility that I messed it up (ha!) so I will try again tonight. Thanks very much for the reply.

    #11219
    Linda
    Participant

    Still not working.

    I put the following in a code snippet:

    //Create a new image size in WP
    add_action( ‘after_setup_theme’, function() {
    add_image_size( ‘trost-size-name’, 250, 250, true );
    } );

    //regenerate thumbnails (I did this manually)

    //Tell WPSP to use this new size (tried this from first page, then commented out with below specific to my list
    //add_filter( ‘wpsp_default_image_size’, function() {
    // return ‘trost-size-name’;
    //} );

    //use it in my show posts list
    add_filter( ‘wpsp_default_image_size’, function( $size, $settings ) {
    if ( 1215 === $settings[‘list_id’] ) {
    return ‘trost-size-name’;
    }

    return $size;
    }, 10, 2 );

    ——————————————————–
    I modified inc/functions.php to replace line 193
    the_post_thumbnail( apply_filters( ‘wpsp_default_image_size’, ‘full’, $settings ), array( ‘itemprop’ => ‘image’ ) );
    ——————————————————–
    Still doesn’t take, an inspect on page shows the following
    <div class=”wp-show-posts-image wpsp-image-left “>
    Advanced Puppy
    </div>
    ——————————————————–
    current ngrok link in case you get a chance to view:
    http://343ee9c7.ngrok.io/our-classes/
    ——————————————————–

    Any ideas what I might be missing?
    Thanks, Linda

    #11244
    Tom
    Keymaster

    Just to confirm, did you remove the image sizing options from the list settings? The above code will only work if those image size options aren’t being used.

    #11269
    Linda
    Participant

    Thanks for checking back, that seems to be my problem. I removed any image size info from the post list settings screen, and now it appears to be working! Thanks so much for walking me through it.

    #11274
    Tom
    Keymaster

    No problem! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.