Forums

Exclude category from first post on homepage (3 posts)

  1. erikhgm
    Member
    Posted 8 months ago #

    I use categories to make the thumbnail size change from 'thumbnail' to 'large' size in the main loop. When category is 35 the thumbnail automatically change to 'large'.
    However I cant make this to work for the first post in the loop.
    And I cant figure out whats wrong in the code:
    Thanks
    Erik

    http://pastebin.com/w6EydHzH

  2. alchymyth
    The Sweeper
    Posted 8 months ago #

    When category is 35 the thumbnail automatically change to 'large'.

    how is that coded?

    this code is probably missing in your pastebin code.

    or are you using a category template for category 35?

  3. erikhgm
    Member
    Posted 8 months ago #

    I actually got this to work now with this new code
    http://pastebin.com/gpSrs2Hu

    It basically just changes the this part of the code if the post is in category 35 which is where I put the posts that I want to have a large thumbnail.

    from:
    <?php the_post_thumbnail('thumbnail'); ?>

    to:
    <?php the_post_thumbnail('large'); ?>

    I am thinking though there must be a better way to do this with less code. This way generates lots of extra code.

Reply

You must log in to post.

About this Topic