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.
-
AuthorPosts
-
September 14, 2019 at 11:31 am #11124
Linda
ParticipantI 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?
September 14, 2019 at 11:31 am #11125Linda
ParticipantOops, the post I was referring to: https://wpshowposts.com/support/topic/show-posts-images-not-working/
September 16, 2019 at 3:39 pm #11159Linda
ParticipantAll 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`
September 16, 2019 at 3:52 pm #11160Linda
Participantokay… 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.September 18, 2019 at 4:56 pm #11186Tom
KeymasterHi 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
September 20, 2019 at 6:40 am #11208Linda
ParticipantI 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.
September 20, 2019 at 2:25 pm #11219Linda
ParticipantStill 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 “>
</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, LindaSeptember 23, 2019 at 4:01 pm #11244Tom
KeymasterJust 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.
September 24, 2019 at 2:38 pm #11269Linda
ParticipantThanks 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.
September 24, 2019 at 4:52 pm #11274Tom
KeymasterNo problem! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.