Tagged: x
-
AuthorPosts
-
April 17, 2016 at 12:35 pm #886974
cmeklirParticipantWe have a gallery page that is using the layout-portfolio template. It is displaying featured images of portfolio items and cropping them. The stack choice is Integrity.
What do I need to change in order to stop cropping of the images?April 17, 2016 at 11:27 pm #887476
Rue NelModeratorHello There,
Thanks for writing in! The featured images will automatically insert the custom image size hard coded in X. This size is set by default which will be calculated based on the global layout settings. If you want to display the full image, what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.
function x_featured_image( $cropped = '' ) { $stack = x_get_stack(); $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false; $full = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); if ( has_post_thumbnail() ) { $thumb = get_the_post_thumbnail( NULL, 'full', NULL ); //var_dump($thumb); switch ( is_singular() ) { case true: printf( '<div class="entry-thumb">%s</div>', $thumb ); break; case false: printf( '<a href="%1$s" data-rel="lightbox easy" class="entry-thumb" title="%2$s">%3$s</a>', $full[0], esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ), $thumb ); break; } } }Hope this helps.
April 18, 2016 at 10:16 am #888435
cmeklirParticipantYes, but I want them smaller just not cropped. How would I change the above code to get one of the other WordPress image sizes?
April 19, 2016 at 12:01 am #889284
LelyModeratorHi There,
The above suggestion will stop the cropping of the images. If you want to display the image not cropped and smaller, we need to add CSS to manage the display aside from above suggestion. Please do give us the URL of the page so we can help you better with some custom CSS.
Always,
XApril 20, 2016 at 2:06 pm #892344
cmeklirParticipantThanks that got it without changing any css.
April 20, 2016 at 10:50 pm #892935
John EzraMemberYou’re most welcome! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-886974 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
