<?php if ( is_home() || is_front_page() ) { ?> <?php } else { ?> <div class="inner-banner" style="background:url( <?php if (has_post_thumbnail()) { ?> <?php echo get_the_post_thumbnail_url($post->ID, 'full') ?> <?php } else { ?> <?php bloginfo('stylesheet_directory'); ?>/images/default.jpg<?php } ?>) no-repeat center center / cover;"> <h2><?php the_title(); ?></h2> </div> <?php }?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter