WP_get_image_editor resizing images in a foreach loop

wp_get_image_editor can return a WP_Error object, which appears to be what’s happening in the code. The code never checks for this and tries to resize an image, thinking it’s calling resize on an image editing object. You need to make 2 adjustments: check if $editor is a WP_Error object add code to print out the … Read more

still need help-images inside wp-content/ uploads/ are not showing up in my media library and uploaded using FTP protocol

It looks, that there is a problem in your database, even more possible when you got “could not insert post into the database”. Have a look into your database, go to the wp_posts table and inspect entries with post_type “attachment”. Here are the attachments saved in your database. Pick several attachments and write down their … Read more

WordPress 5: including larger thumbnail image sizes in srcset than I have set

Good question as I know that this can be a pain in the butthole. Please see this page; https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/. From the docs: get_the_post_thumbnail_url($id, ‘image-size’) So in your case: $img = get_the_post_thumbnail_url($post, ‘article-lede’); echo “<img src=”https://wordpress.stackexchange.com/questions/353305/{$img}” class=”featured-image img-fluid” />”;

Site only working in browser where I created it

It could also be the site URL and Home settings in your database. They might be ‘localhost’ or another URL only accessible in that browser. If it’s that, you’ll need to change the values for the ‘home’ and ‘siteurl’ options in your database. There’s a few ways shown here. It’s also possible, but less likely … Read more

Get post thumbnail in specific size

First, you have to add custom image size using add_image_size, so when you upload new image using media uploader it will create thumbnail of that size which you assign for image. in add_image_size $crop parameter If false, the image will be scaled (default), If true, image will be cropped to the specified dimensions using center … Read more