WordPress gallery grid show original image - wordpress

I'm using the Divi theme to build a website in WordPress. The problem I'm facing is this:
wrong image
I'm using the gallery module to display a set of pictures in grid mode. But all the images loaded are shown as above. Id like to display the original image instead of the medium one.
original image
WordPress creates some versions of my images but the aspect ratio is different, so this crop effect is applied on my gallery items.
I have tried to set the correct size on medium images from media settings and generated the images again but nothing changed.

Divi theme uses its own functions to generate thumbnails that hard crop original images by default.
Try editing post_thubnails_divi.php file on theme folder using the dimensions that suit you and set the crop value to false.
$crop = apply_filters( 'et_post_thumbnails_crop', false );

hi you can download the Gallery layout and install it in your DIVI theme. it give some layout options for gallery design.
https://www.elegantthemes.com/blog/divi-resources/free-divi-photo-gallery-layout-pack-5-stunning-gallery-page-layouts-in-one-convenient-download
Note : subscribe it and they will send the downloadable link to your email
thanks

Related

Twitter large Images using Wordpress

I have created 2 blogposts in wordpress and shared them in twitter.
The twitter URLs are
https://twitter.com/Jagannathan6/status/1423662392534175744?s=20
and the other is
https://twitter.com/Jagannathan6/status/1423197036195717124?s=20
As you see the image appears as a thumbnail in one tweet and as a large image in another. How to make the thumbnail image appear as a large image? Has it got something with the size of the image?
I am looking for an answer where I need not get premium version of wordpress.
Easiest way is to use Yoast plugin. Taking a look at the two tweets I'm wondering:
Are you using media sizes to size the images (Wordpress takes the largest image it can and resizes and/or crops smaller images to fit the sizes in the Media options menu)?
Are you using Yoast or custom hooks to post the images to twitter?
Are you using the same size images for both posts?
Are you attaching the images as Featured Images in the editor in the same way?
Did you post them to twitter in the same way?
Do both posts have snippets / excerpts applied to them? If not, make sure your theme is calling the_excerpt, or else you've configured the excerpt to pull from the main body of the post, or else hand-craft the excerpt in the relevant meta box.
Do both images have meta tags / alt tags applied to them? Check in the Media Library or in the post > edit image and see that alt text, caption and description are all filled out.
Did you test the images first with https://cards-dev.twitter.com/validator ?

Woocommerce product images are being cropped

Here are the settings i use on the website for the woocommerce images.
If you visit the website homepage, you will notice that the images with the 3 rows are being cropped but everywhere else they are normal. (right below in the special offers section they are okay, with the same size)
If you inspect an image and open in new tab, you will notice they are actually cropped. Those rows are created with siteorigin plugin and the widget is the product tyche widget of the theme tyche.
What could be the solution of this issue? Why the images are being cropped at those 3 rows? (Gaming, accessories, merchandise)
It might be the issue for different sizes of the 3 images. Try to do all the images equal size then add the pictures again. Hopefully, it will work.
Okay it was a theme issue and not Woocommerce.
Thanks to Simple Image Sizes plugin, I managed to fix the issue simply by disabling cropping on all of the theme images and resizing those image to the proper size so they get the perfect quality!

Wordpress single page : using original images

As a photographer i need my photos to be sharp. When i upload my photos on my Wordpress, they are resized in many different ways. I'd like to use the original one instead of a resized one, event if it takes a little bit longer.
As you can see on the link below, the image in the post is resized :
<img src="https://www.pixelkomando.com/cont/2017/08/ORIGINAL-1160x770.jpg" width="1160" height="770">
But i'd like :
<img src="https://www.pixelkomando.com/cont/2017/08/ORIGINAL.jpg" width="1160" height="770">
Here's the link : https://www.pixelkomando.com/gare-de-durnal/
Thanks for your help!
VFero
You probably want to do something like in this article.
From the article:
You can stop WordPress from generating default image sizes by visiting
Settings » Media in WordPress admin area. There you will see default
image sizes predefined by WordPress. You need to set these sizes to 0
which will prevent WordPress from generating default image sizes when
you upload a new image.
and also:
Find the theme size code in your theme’s functions.php file. Simply
look for the code line containing add_image_size() function. ... Removing these lines will stop your theme from generating those image sizes.
Warning:
But be aware that this will force everyone on a mobile to download the original version of the images. Thanks at #FluffyKitten for pointing this out in the comments.

How do I change my wordpress image sizes?

I upload images around 500x500kb (vary slightly as I resize with a percentage). Wordpress is set to create thumbnails at 150x150.
However, I'm getting 'serve scaled images' errors for two file sizes (dimensions added to end of file title) that are begin resized. One is 272 x 148 and the other is 160x160, yet these sizes aren't in Wordpress media settings. I'm guessing they are theme-specific.
But, as these files appear to be created automatically, how do I set it up so that files are created with the dimensions that are obviously needed by my theme.
And, how does my theme know which version to grab?
Thanks!
Adding new image size
You are looking for Wordpress add_image_size function.
Registers a new image size. This means WordPress will create a copy of the image with the specified dimensions when a new image is uploaded.
In your case:
add_image_size('your-custom-size-name', 272, 148, true);
More info on codex: http://codex.wordpress.org/Function_Reference/add_image_size
New image size in theme
Your theme grabs the image size you ask for with the function get_post_image_thumbnail.
get_the_post_thumbnail($post_id, 'your-custom-size-name');
Resizing existing images
If you've already uploaded some images, you may want to adjust them to the new dimensions automatically. There are few plugins that do so, for example Regenerate thumbnails.
Also, you may want to look to all-in-one tutorial on TutsPlus I've found while googling for the plugin.

How do I use two different images, one as a thumbnail and one as a linked image

I want to do an image gallery in a page, where the linked image (a href) is different from the thumbnail's src. I need to have the ability to change the thumbnail image. Its important because for each image i have a different thumbnail (different content and size).
What can I do?
You can use this plugin which have different options to set the image URL and image size
Plugin : WP Gallery Custom Link
May be it helps you to solve this issue.
You can use this plugin to asign different image sizes to different links.
Plugin: gallery with custom links

Resources