Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #777394

    Dear Kriesi team,

    I am currently looking for a solution to add image credits to Featured Images when creating a blog post. There seems to be a solution for this, but unfortunately I can’t seem to make it work.

    I found the following instruction here: http://www.sourcexpress.com/how-to-add-caption-to-the-featured-images-in-wordpress/

    It says this:

    Now you would need to find the section where the featured image is called. It would be mostly in content.php or single.php or content-single.php or page.php etc and may look like the below or something similar

    <div class=”entry-thumbnail”>
    <?php the_post_thumbnail(”); ?> <!– This displays the featured image –>
    </div>

    Unfortunately I cannot find this code snippet anywhere. Can you help me out? Or is there maybe a native solution to provide image captions for the Featured Images of blog posts? I found some plugins, but unfortunately they only help with adding image captions to images you insert into the blog post, not featured images themselves.

    Thanks,
    Felix

    #777418

    Hey Felix,

    You can try the following:

    Edit includes > loop-index.php, find this code:

    
    if($slider) $slider = '<a href="'.$link.'">'.$slider.'</a>';
    			if($slider) echo '<div class="big-preview '.$blog_style.'">'.$slider.'</div>';

    Below that add the following:

    $description = get_post_field('post_content', get_post_thumbnail_id());
    			echo $description;

    You can use the “Description” field on the image attachment editor page (Media > Library > Edit) to save a description text.

    Best regards,
    Jordan Shannon

    #777433

    Hi Jordan,

    Thanks a lot!

    Something appears below the image now, it’s a start ;-) I was hoping though it could be integrated onto the image like in the article here
    Screenshot of Caption appearing on top of the image

    Is that possible?

    Also: what approach would I need to use if I’m using a child theme? I don’t want the changes to get lost after updating the site ;-)

    Thank you,
    Felix

    • This reply was modified 7 years, 7 months ago by Trystan.
    #777551

    Hi,

    I am not able to see the image you pasted above. Would you be able to share the page/site in question? Hopefully it is something we can correct with css.

    As for the changes made, just duplicate the edited file structure in the child theme folder and it will override the parent theme.

    In this case create includes > loop-index.php(paste from parent theme) within the child theme folder.

    This way your changes are safe during updates.

    Best regards,
    Jordan Shannon

    #777787

    Hi Jordan,

    The image is just a screenshot from this article ;-)
    http://www.sourcexpress.com/how-to-add-caption-to-the-featured-images-in-wordpress/

    You can find the login credentials below if you would like to take a look.

    Best regards,
    Felix

    #777896

    Hi,

    I am receiving a server error when I try to access the ftp link. Can you please check it?

    Best regards,
    Jordan Shannon

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.