- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I need some help here. I have a real estate site built on Winning Agent Pro Theme and looks great but will be great if it can load faster.
Actually, I already open a support ticket at WordPress about this issue but then someone advice me to post it here. By the way, you can check my real issue here: http://wordpress.org/support/topic/set-the-maximum-width-and-height-of-images
It would be great if someone can/able to show me how to resolve the problem.
Thanks in advance.
The AgentPress Listings plugin is using the
genesis_get_image() function to display the image background. Which is asking for the image size 'properies'. The function uses
wp_get_attachment_image() to retrieve the image from WordPress. As far as I could tell (I did a quick grep search on the plugin directory), the AgentPress Listings plugin does not register the image size with WordPress (see add_image_size).
If WordPress cannot find the size given (as a string), it will return the original image. This should be why you are getting back the large (original) image.
There are a few ways to fix this.
1. Add the image size to your functions, then install and run Regenerate Thumbnails to add your existing photos to the new image size.
2. Hook the 'genesis_pre_get_image' filter and adjust the size parameter to medium (or an already existing image size) from 'properties.'
3. There are probably more ways to do this.
I hope this helps.
I quickly created a gist for solution two. I was not able to test it fully as I do not have the theme, but the logic is there.
You're my man. It's working. I can't thank you enough.
© 2023 WPEngine, Inc.