jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Portfolio shortcode: use smaller images

Open jeherve opened this issue 12 years ago • 9 comments

The Portfolio shortcode uses the full Post Thumbnail image, even if shortcode actually displays small images: https://github.com/Automattic/jetpack/blob/master/modules/custom-post-types/portfolios.php#L718

It'd be nice if the image sizes could match the column size.

Reported here: https://wordpress.org/support/topic/portfolio-page-thumbnails?replies=2

jeherve avatar Oct 11 '14 11:10 jeherve

Just wondering if there has been any progress on the full Post Thumbnail bug? I have a number of portfolio-centered sites that use the Portfolio short codes, but after a month and no updates to the Custom Content Types plugin, I am pondering looking for a new portfolio solution. I would be able to help on testing if an update comes along.

gordo019 avatar Nov 14 '14 18:11 gordo019

We should probably use the large thumbnail size, which would load images at the $content_width dimensions. I'll need to do some testing to make sure it doesn't break many things.

We could also serve images that are the column width, but not everyone runs Photon, and those sizes wouldn't be registered - thus serving the full size image again, just resized in the browser.

michaeldcain avatar Nov 21 '14 13:11 michaeldcain

Glad to see some planning on this problem. Let me know if you need a tester. Currently, serving the full size image (retina rez in my case) turns the portfolio page (only 6 thumbnails) into a 10MB page load. http://rogirlaspen.com/my-portfolio/

gordo019 avatar Nov 21 '14 16:11 gordo019

URL correction: http://pyrogirlaspen.com/my-portfolio/

gordo019 avatar Nov 21 '14 16:11 gordo019

Please! Please! fix this issue for WP 4.1 and your next Jetpack update.

gordo019 avatar Dec 12 '14 19:12 gordo019

Still a bug at WP4.1 and Jetpack 3.3. We need a solution or a workaround. Any ideas?

gordo019 avatar Dec 19 '14 00:12 gordo019

@gordo019: I didn't get a chance to prep a pull request for this before 3.3. I'll go ahead and make one for 3.4, but in the meantime, you can just edit L753 in '/modules/custom-post-types/portfolios.php' to use 'large' instead of 'full':

return '<a class="portfolio-featured-image" href="' . esc_url( get_permalink( $post_id ) ) . '">' . get_the_post_thumbnail( $post_id, 'large' ) . '</a>';

michaeldcain avatar Dec 19 '14 14:12 michaeldcain

Thanx for the Christmas present! That dropped the page load by 66% and seems good now.

gordo019 avatar Dec 19 '14 17:12 gordo019

No problem. Sorry it didn't make it into 3.3. I'll make that edit and maybe add a filter for 3.4.

michaeldcain avatar Dec 19 '14 18:12 michaeldcain