WordPress.org

Ready to get started?Download WordPress

Forums

Style post format on home only (3 posts)

  1. Ottens
    Member
    Posted 1 year ago #

    I'm trying to style the post format aside only on the front page of my blog. Specifically, I want it to give me a larger thumbnail there. Problem is, that also changes the way aside posts are displayed in tag and category archives -- which I don't want.

    This is what I have in my content.php:

    <?php
    		if ( has_post_format('aside') ) {
    		the_post_thumbnail('large');
    		} else {
    		the_post_thumbnail('medium');
    		}
    		?>

    Adding either && is_front_page() or && is_home() to the first conditional statement, however, doesn't seem to make a difference. Am I doing something wrong?

  2. bcworkz
    Member
    Posted 1 year ago #

    Does your theme have a content-aside.php template? Your script belongs there, though you obviously do not need to check the format any more.

  3. Ottens
    Member
    Posted 1 year ago #

    Thanks for your reply, bcworkz.

    I tried that, adding a content-aside.php, but it doesn't make a difference because whether it's the home page or an archive page, it then pulls in that one for the template and I still end up with an image that's too big.

Topic Closed

This topic has been closed to new replies.

About this Topic