Tagged: x
-
AuthorPosts
-
March 6, 2017 at 4:44 am #1395995
brightboysquadParticipantHi team. I have read the forum regarding the way the Masonry blog displays the default (large) blog images and the displays them to 1/3 of the original size. Question: Is there a way for me to hack that and to force the blog to use another image? An image I have optimized to the smaller dimensions? (All my client’s images are already optimized and compressed but the blog is slow to load because of all the images that get displayed at only at 1/3 of their original size).
Question 2: If there is no way to use a smaller file, is there a way to not use any images at all?
March 6, 2017 at 5:23 am #1396033
LelyModeratorHi There,
Since the issue is loading time, why not use caching and CDN to host your images? Please check this article:https://community.theme.co/kb/performance/
Hope this helps.
March 6, 2017 at 9:42 am #1396358
brightboysquadParticipantHi, the issue is not a CDN. The issue is the images. Please understand I love X, I only develop with X. BUT! This issue is something ALL my clients face sooner or later. I understand your position; it’s not on your radar for now. I’d like to know id there is anything I can do to make the blog overview page move faster myself.
Will this help? “Set the default Featured Image (formerly Post Thumbnail) dimensions. To register additional image sizes for Featured Images use: add_image_size().”
https://codex.wordpress.org/Function_Reference/set_post_thumbnail_sizeMarch 6, 2017 at 10:30 am #1396429
DarshanaModeratorHi there,
To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
March 6, 2017 at 10:56 am #1396489
brightboysquadParticipantThis reply has been marked as private.March 6, 2017 at 12:53 pm #1396642
RupokMemberHi there,
It’s loading pretty fast on my end. Still you can optimize the featured images a bit more.
Cheers!
March 6, 2017 at 1:03 pm #1396656
brightboysquadParticipantHi, yes just a tad bit indeed, I know. Thats not where I am looking to find improvements. I want to improve the 90% too large images that are being scaled down in HTML/CSS as I hoped you understand by know.
Look, I totally understand you are working on other great stuff. I do, really. All I want is to find a way to create smaller images myself. This is something that affects all my client’s blogs.
I also understand if you don’t know if using an additional image sizes for Featured Images (as I mentioned above) will work. Please let know if thats the case. I can fill you in if I find a way that works, ok?
March 7, 2017 at 2:40 am #1397383
ChristianModeratorPlease add the code below in your child theme’s functions.php
function x_featured_image( $cropped = '' ) { $stack = x_get_stack(); $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false; if ( has_post_thumbnail() ) { if ( $cropped == 'cropped' ) { if ( $fullwidth ) { $thumb = get_the_post_thumbnail( NULL, 'entry-cropped-fullwidth', NULL ); } else { $thumb = get_the_post_thumbnail( NULL, 'entry-cropped', NULL ); } } else { if ( $fullwidth ) { $thumb = get_the_post_thumbnail( NULL, 'entry-fullwidth', NULL ); } else { $thumb = get_the_post_thumbnail( NULL, 'entry', NULL ); } } // Configure this $thumb = get_the_post_thumbnail( NULL, 'medium', NULL ); switch ( is_singular() ) { case true: printf( '<div class="entry-thumb">%s</div>', $thumb ); break; case false: printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>', esc_url( get_permalink() ), esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ), $thumb ); break; } } }Change the setting in
get_the_post_thumbnailin this part of the code// Configure this $thumb = get_the_post_thumbnail( NULL, 'medium', NULL );For more details, please see https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/
Thanks.
March 7, 2017 at 2:53 am #1397398
brightboysquadParticipantWhy Christian, thank you very much for contributing! I will pick this up right away! Muchos Graçias.
March 7, 2017 at 5:50 am #1397590
ChristianModeratorYou’re welcome.
March 7, 2017 at 10:23 am #1397887
brightboysquadParticipantHUUUUUUGE difference! Wow. Excellent! Thank you Christiaan. We’ve improved loading with at least 100%! Fully loaded was 15.5 sec, now 3.9. (Also added a different caching plugin, W3TC). I salute you sir!
March 7, 2017 at 6:06 pm #1398393
FriechModeratorYou’re more than welcome, glad we could help.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1395995 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
