Site logo

Archived topic

How to show Featured Image Caption

18 replies · Started by Sagar on October 27, 2020

Viewing posts 1–15 of 19

Hi,
I want to show featured image caption on all my blog posts. Captions are to be entered manually to give the attribution.

Like this news website has given
https://www.hindustantimes.com/it-s-viral/dad-s-complete-guide-to-baby-video-is-absolutely-hilarious-watch/story-opDXsEccg885ZFQXLnWooL.html

The caption is: “The image shows a shot from the video. (Instagram/@howtodadnz)”

Remember that, it will be different for all the blog posts.

Thank you

Hi Leo,
Why don't you enable this as a default option for all the users? If anyone wants to use it they will use otherwise no.
It's just a small thing which much be enabled by default.

Which Amp plugin are you using ?

In the code Leo provided a link to here:

Try changing this:

} else {

to

} elseif( !is_amp_endpoint() ) {

Why don’t you enable this as a default option for all the users? If anyone wants to use it they will use otherwise no.
It’s just a small thing that must be enabled by default.
Playing with codes is a scary thing for me for my website.

} else {

to

} elseif( !is_amp_endpoint() ) {

I did this. Now the featured image is not showing in the amp pages.

I'll check with David to see if the code can be modified some more.

Thanks for the suggestion.

I'll mention it to our team :)

Sorry about that - revert that change and instead try updating this line:

if( $html == '' ) {

to

if( $html == '' || is_amp_endpoint() ) {

Again, none of the featured images showing on any AMP page after this code.

Sorry, I cleared the cache. Now it is working well. But please take my feedback to enable this featured image caption by default in the GP theme.
As I'm really too far away from coding.

This archived topic is closed to new replies.