• Hi,
    I have an image at the top of my “index.php” page before the loop.
    What I can’t seem to figure out how to do is stop the image from displaying if the first post has a specific format of, in my case, “aside”.

    Can anyone help me with this?

    Here’s a snippet of what the html structure looks like.
    (minus irrelevant code for this dilemma)

    <div class="featured-image">
    	<img src="https://samdashton.co.uk/wp-content/uploads/2014/05/desk.jpg">
    </div>
    
    <?php if ( have_posts() ) : ?>
    	<?php while ( have_posts() ) : the_post(); ?>
    		<?php get_template_part( 'content', get_post_format() ); ?>
    	<?php endwhile; ?>
    <?php endif; ?>

    Thanks ??

  • The topic ‘Hide image outside (above) loop when first post is a specific format’ is closed to new replies.