-
AuthorPosts
-
April 13, 2017 at 5:27 pm #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,
FelixApril 13, 2017 at 6:07 pm #777418Hey 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 ShannonApril 13, 2017 at 6:24 pm #777433Hi 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
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, 8 months ago by Trystan.
April 13, 2017 at 9:51 pm #777551Hi,
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 ShannonApril 14, 2017 at 12:33 pm #777787Hi 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,
FelixApril 14, 2017 at 5:12 pm #777896Hi,
I am receiving a server error when I try to access the ftp link. Can you please check it?
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.