I’m using a theme which uses wp_get_attachment_image to implement the display of featured image and thumbnails on the category pages. (I have no use for the thumbnails, so I’ve edited out that part of the code.) I’ve noticed that having multiple posts in a category that have featured images attached to them, results in exponentially slow loading of the category page. I’ve confirmed this by removing all featured images from posts except for one post in each category, which results in a nearly normal load time for the pages.
This seems like a really excessive delay. You should be able to have many posts in a given category which have an image attached to them, without it affecting the load time of your category page, right? Here is the code I’m looking at and I’m wondering if the theme I’m working with is using this the right way. Is there anything wrong here?