Tagged: image
- This topic has 7 replies, 2 voices, and was last updated 5 years, 1 month ago by Skandha.
-
AuthorPosts
-
February 24, 2019 at 8:30 am #166552m.tenbrinkParticipant
Hello together,
is it possiple ta add captions to the image of an post. In the customizer I can’t find anny option to switch on this for my page.
See URL: kdtv-euregio.eu
In normal case I need the captions on my landing page.
Best regards
m.tenbrinkFebruary 24, 2019 at 11:24 pm #166603SkandhaParticipant@m-tenbrink: Hello there,
Yes, it is possible to add captions to the featured images of the post. For that you will need to create a child theme and do a little bit of customization. Let me know if you are familiar with child theme customization.Kind Regards,
SkandhaFebruary 25, 2019 at 4:17 am #166634m.tenbrinkParticipantHello Skanda,
I have setup an second installation with on an local computer. For this installation I have implemented already an child theme for the customization. With this way I can test every changes before I transfer the result to the public page.
Best regards
m.tenbrinkFebruary 27, 2019 at 1:44 am #166811SkandhaParticipant@m-tenbrink: Go to => Child Theme Folder => functions.php and add the Code in this link.
Then Go to => Dashboard => Media => Click on the image where you want to add your caption text in the Caption field
Now the caption should show up below the featured image.
Let me know if this helps you out!
Kind Regards,
SkandhaFebruary 27, 2019 at 4:27 pm #166863m.tenbrinkParticipantHello Skanda,
I got an error massage: unexpected ‘;’ in row 28. This is the row with the first “if” statement.
Best regards
m.tenbrinkFebruary 28, 2019 at 12:41 am #166897SkandhaParticipant@m-tenbrink: Can you try adding the following code and check if it works out?
Go to => Child Theme Folder => functions.php and add the following Code.function clean_journal_archive_content_image() { $options = clean_journal_get_theme_options(); $featured_image = $options['content_layout']; if ( has_post_thumbnail() && 'full-content' != $featured_image ) { ?> <figure class="featured-image"> <a rel="bookmark" href="<?php the_permalink(); ?>"> <?php if ( 'excerpt-image-left' == $featured_image || 'excerpt-image-right' == $featured_image ) { the_post_thumbnail( 'clean-journal-landscape' ); } elseif ( 'excerpt-image-top' == $featured_image ) { the_post_thumbnail( 'clean-journal-featured' ); } elseif ( 'excerpt-full-image' == $featured_image ) { the_post_thumbnail( 'full' ); } ?> </a> <?php if (get_post(get_post_thumbnail_id())->post_excerpt) { // search for if the image has caption added on it ?> <span class="featured-image-caption"> <?php echo wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt); // displays the image caption ?> </span> <?php } ?> </figure> <?php } }
Let me know if this works out!
Kind Regards,
SkandhaFebruary 28, 2019 at 1:06 am #166899m.tenbrinkParticipantHello Skandha,
yes this works fine now.
Thank you for your kindly support.Best regards
m.tenbrinkFebruary 28, 2019 at 1:12 am #166900SkandhaParticipant@m-tenbrink: Hello there, I hope I was able to resolve your issue. If it’s not too much trouble, I have a quick request: could you please leave an honest review?
https://wordpress.org/support/theme/clean-journal/reviews/#new-post
Your review will help others know what to expect when they’re looking for the support I offer. Even a sentence or two would be hugely appreciated. Thanks, and if there’s anything else at all that I can do to help, don’t hesitate to let me know. Have a good day! 🙂Kind Regards,
Skandha -
AuthorPosts
- The topic ‘caption for images’ is closed to new replies.