Custom Image sizing in WordPress theme - wordpress

I am having some trouble with a preset image size in WordPress. I was matching the design on the homepage with the agentpress 2.0 theme by StudioPress.
I found that I could customize the preset image sizes in the functions.php file of the theme. That worked fine until I realized the image size preset that I changed I still needed for the interior pages. I think simply switched it back to it's original dimensions and created a new one for the custom size I needed for the homepage. That seemed to work for the homepage but the interior pages are still taking on the old dimensions. It is as if the site is cached or something except I am not using a caching plugin. When I check the source it is indeed the old dimensions.
Here is a link to the page: http://districtdesigngroup.com/fox-realty/?status=for-sale
Here is a link to the demo: http://demo.studiopress.com/agentpress/status/for-sale
You will see the thumbnail is not looking correct.
Is there a way to reset the theme or something to make these changes take effect? What is wrong here?

I am not sure what you mean, but if you wish to re-generate your existing thumbnails so their sizes are readapted according to the new dimensions you have defined in Settings>Media or in functions.php (with add_image_size), just use the WordPress plugin "Regenerate Thumbnails". It works brilliantly (I used it many times before). It will take the original source images and regenerate all thumbnails at all defined image sizes. I hope I understood what your problem is.

Related

Wordpress theme uses a deleted image

I am using a wordpress theme for my website and when installing the theme I made sure to avoid imporing the media files of the theme. The problem is that the theme keeps using a featured image that doesn't exist. I have tried to replace the image with my own and when inspecting the page I can see that I am using mine but what us displayed is always the theme default image.
Is there anyway to solve this, because I have cleaned all my website and tried again but no result.
Thanks.
1.can you check the template file if that is a part of the header or footer
could be that the image is hard-coded
2.if you have cache enabled try deleting the cache
3.Sometimes the demo content in themes is linked with images from the developers website demo site
check the network tab if the image is fetched from a different website.

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.

woocommerce using full size images, resized, for thumbnails

I have an up to date install of wordpress and woocommerce using a pretty simple, customized theme.
I recently noticed that woocommerce is not calling thumbnail images for catalog pages, the cart, anywhere.. i hadn't noticed earlier because everything looks OK. For example: the cart displays 32x32px thumbnails, but is merely re-sizing the original image (1000x10000px) down to 32x32 instead of calling a smaller file such as the 150x150px thumbnails. it seems to be doing this anywhere a smaller image is used and my main catalog page is almost 40mb which is ridiculous- it should only weigh 1.5 or 2mb...
if you're feeling frisky, the 40mb catalog page is at superfly5000.com/collections/ (NSFW!!!)
Both woocommerce and wordpress image settings are set to 150x150 and 300x300. WC single product images and WP large size images are set to 0x0 so it will call the original image.
I have regenerated thumbnails and am about to convert all my PNG's to JPG's to save some weight but I really don't want to lose transparencies..
Any ideas??
You have to enable the hard-crop option for thumbnails, more info.
resolved: cool thanks,Vikas, the hard crop wasn't the issue but the snippet at the bottom of the page (https://docs.woothemes.com/document/adding-product-images-and-galleries/#section-4)- manually calling image sizes from the functions.php and regenerating thumbnails apparently did the trick. for some reason WC wasn't using it's own image sizes settings- i don't know why.

Wordpress returns old thumbnail size after changing media settings

I have had a requirement to update a WP build so that the thumbnail size changes from (the default) 150x150 to 500x500.
I've amended the size within the Settings > Media and utilised the awesome "Regenerate Thumbnails" plug-in to create the image files at the new sizes. So everything should be cool... alas not!
When I call my new image thumbnail wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()),'thumbnail'); Wordpress is still returning my image as ...150x150.jpg and not the new thumbnail size.
I've attempted updating the page/post in which the image appears but this doesn't seem to work. Any ideas?
Note: I am using a multi-site instance of Wordpress, but I've checked each instance to ensure that the images have been resized and that the settings have updated. Everything seems to be working correctly.
Change the resize function to a different tag, i.e. "thumbnail_2".
Regen the thumbnails and check to see if the new size reference works wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()),'thumbnail_2');
thumbnail is a WP default term, same as you couldn't (probably) create a custom post type named post. Every CMS and framework have defaults that cannot (shouldn't) be overridden. There are many, many reasons for this. It's not a work around, just "the way".

Re-process all Images in WordPress

I've got a blog that has the highest-resolution version of all its images embedded in the posts, rather than a thumbnail linking off to an image attachment page.
Can you tell me how I can re-process all embedded images so they're output as reduced size thumbnails that link off to their own attachment page (which is WordPress default settings)?
Am I right in thinking I can involve the Regenerate Thumbnails plugin in this?
That was just about what I would suggest, it works wonders, but it will take longer depending on the amount of photos.
Another thing you can do is run the images through an optimizer before posting to speed up load times.
I don't know about this plugin but there is a plugin called auto post thunbnail for wordpress. I have used it and it works great. You just press the generate button and wait till it generates thumbnails for all of your posts, if they have an image in them.

Resources