How to automatically load an image inside the post, since it is present in uploads folder
You should check if those files exist before you output that div. You can clean up your markup and get rid of that onerror call by wrapping each image div in a file_exists check. Use a ternary to check if the file exists and set the $image variable if it is. Like so: $image1 = … Read more