Tagged: x
-
AuthorPosts
-
September 7, 2016 at 6:05 pm #1165285
rsmith4321ParticipantCould I add something to my child theme functions.php to change the thumbnail size used for the entry-featured entry-thumb class. I want to switch the entry-featured thumbnail size for my large thumbnail size in the entry-thumb div at the beginning of each blog post. I can accomplish what I want in the following code, I just don’t know how to add this to my functions.php so it won’t be erased by a theme update. Thanks.
if ( ! function_exists( 'x_featured_image' ) ) : 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, 'large', NULL ); } else { $thumb = get_the_post_thumbnail( NULL, 'entry', 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; } } } endif;September 8, 2016 at 12:18 am #1165843
LelyModeratorHi There,
Yes, you can add that code on your child theme’s functions.php file. Child theme is safe from theme update.
In case you don’t have a child theme yet, I’d advise that you setup 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.September 12, 2016 at 7:36 pm #1172194
rsmith4321ParticipantThanks, I’m just not sure exactly how to implement it. I would have to wrap it in a custom function correct? Could you just tell me how to implement the code so it would work in my child theme functions.php?
September 13, 2016 at 1:19 am #1172580
RupokMemberHi there,
You need to add that code on your child theme’s functions.php file. If the code is correct then it should work.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1165285 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
