Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #166552
    m.tenbrink
    Participant

    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.tenbrink

    #166603
    Skandha
    Keymaster

    @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,
    Skandha

    #166634
    m.tenbrink
    Participant

    Hello 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.tenbrink

    #166811
    Skandha
    Keymaster

    @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,
    Skandha

    #166863
    m.tenbrink
    Participant

    Hello Skanda,

    I got an error massage: unexpected ‘;’ in row 28. This is the row with the first “if” statement.

    Best regards
    m.tenbrink

    #166897
    Skandha
    Keymaster

    @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,
    Skandha

    #166899
    m.tenbrink
    Participant

    Hello Skandha,

    yes this works fine now.
    Thank you for your kindly support.

    Best regards
    m.tenbrink

    #166900
    Skandha
    Keymaster

    @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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘caption for images’ is closed to new replies.