Tagged: x
-
AuthorPosts
-
February 19, 2017 at 6:18 pm #1377446
arjunaghose22ParticipantCan someone please tell me how i can get the caption for a featured image to display (i.e. print) on the webpage in the Integrity stack?
February 19, 2017 at 11:46 pm #1377733
LelyModeratorHi There,
Because this requires a template change, 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.
Then add the following code on 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; 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 ); } } switch ( is_singular() ) { case true: printf( '<div class="entry-thumb">%s</div>', $thumb ); printf( '<div class="entry-caption">%s</div>', the_post_thumbnail_caption() ); 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; } } }*Note: we have added this line of code:
printf( '<div class="entry-caption">%s</div>', the_post_thumbnail_caption() );
The original function code is on this file:\wp-content\themes\x\framework\functions\global\featured.phpHope this helps.
February 20, 2017 at 12:15 pm #1378528
arjunaghose22ParticipantThat’s great. I will do that. Thank you so much for your help.
February 20, 2017 at 12:56 pm #1378583
JoaoModeratorGlad to hear it,
Cheers
February 24, 2017 at 2:03 pm #1384620
arjunaghose22ParticipantThanks, that works perfectly. Thanks so much for your help. Great service and theme you have here.
February 24, 2017 at 3:33 pm #1384688
JoaoModerator🙂 awesome!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1377446 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
