Zvabolis
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Fixing WordPress
In reply to: Posts not displaying without featured imagesI figured it out using a combination of the two code snippets.
This is the original piece of code:
<?php if ( '' != get_the_post_thumbnail() && ! post_password_required() && ! get_theme_mod('hide_singlethumb') ) : ?> <div class="entry-thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'zuki' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail(); ?></a> </div>The amended code is as follows:
<?php if ( '' != get_the_post_thumbnail() && ! post_password_required() && ! get_theme_mod('hide_singlethumb') ) : ?> <div class="entry-thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'zuki' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail(); ?></a><?php $get_description = get_post(get_post_thumbnail_id())->post_excerpt; if(!empty($get_description)){//If description is not empty show the div echo '<span class="caption_arrow"></span><br><div class="featured_caption">' . $get_description . '</div>'; } ?> </div>I added everything except
the_post_thumbnail();from my second snippet of code right after the</a>of the original code.
Viewing 1 replies (of 1 total)