Archived topic
featured image caption only on single post
1 reply · Started by Daniel on February 27, 2020
Hello GP-Team,
sorry, I answered first on a parallel thread that was already resolved.
I just used this snippet for a while and it works fine.
https://generatepress.com/forums/topic/cant-display-featured-image-captions/
I wonder if there’s a way to add this filter only on a single post? Thanks in Advance.
Best, Daniel
Hi there,
you can try swapping this line:
if( $html == '' ) {
for
if( $html == '' || ! is_single() ) {
So it returns the default HTML if there is no featured image or is !NOT a single post