Tagged: x
-
AuthorPosts
-
January 11, 2017 at 11:16 am #1325839
Jan SParticipantHello,
when using the Ethos Stack plus the “Post Carussel” Slider at the top, i noticed that all of the images used there are 1:1, original, in my case: super large.
How can i set the images to be of size “medium” (at most) ?
Allbest
JanJanuary 11, 2017 at 12:47 pm #1325981
RupokMemberHi Jan,
Thanks for writing in! It looks fine on the screenshot. Would you share your URL so that we can check?
Cheers!
January 12, 2017 at 3:48 am #1326965
Jan SParticipantRupok,
It looks fine, yes, but its full res! I need (and recommend) medium size at most.
Check: http://demo.theme.co/ethos-1/
“castle.jpg” is 1200x750px, 112kb, where 500x? would be completely sufficient (the image will *never* be much larger than that, so why not serve properly scaled images in favor of faster loading times?)
In my case, the client users UHD-Images at >2.400px, resulting in like 20 MB just for the top slider!
January 12, 2017 at 7:12 am #1327128
Paul RModeratorHi,
To make it pull medium size image, you can add this in your child theme’s functions.php file.
function x_ethos_entry_cover( $location ) { if ( $location == 'main-content' ) { ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"> <h2 class="h-entry-cover"><span><?php x_the_alternate_title(); ?></span></h2> </a> </article> <?php } elseif ( $location == 'post-carousel' ) { ?> <?php GLOBAL $post_carousel_entry_id; ?> <article <?php post_class(); ?>> <a class="entry-cover" href="<?php the_permalink(); ?>" style="background-image: url('<?php echo x_make_protocol_relative( x_get_featured_image_url('medium') );?>');"> <h2 class="h-entry-cover"><span><?php ( $post_carousel_entry_id == get_the_ID() ) ? the_title() : x_the_alternate_title(); ?></span></h2> <div class="x-post-carousel-meta"> <span class="entry-cover-author"><?php echo get_the_author(); ?></span> <span class="entry-cover-categories"><?php echo x_ethos_post_categories(); ?></span> <span class="entry-cover-date"><?php echo get_the_date( 'F j, Y' ); ?></span> </div> </a> </article> <?php } }Hope that helps.
January 16, 2017 at 6:35 am #1331934
Jan SParticipantPaul,
imho this should be default, but thank you very, very much for the snippet! Saved work on my end and works perfectly!
All best
JanJanuary 16, 2017 at 7:02 am #1331961
Paul RModeratorYou’re welcome! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1325839 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
