WordPress.org

Ready to get started?Download WordPress

Forums

How to have the first post look different (7 posts)

  1. Daniel591992
    Member
    Posted 6 years ago #

    Hey, I have a theme that requires the first post of index.php to look different. Is there any way to achieve this?

    The first post needs to look like:

    <div class="boxcontents">
    <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>
    </div>

    and the next posts need to be like this:

    <div class="box">
    <div class="boxcontents">
    <h2 class="posttitle"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>
    </div>
  2. Jeremy Clark
    Moderator
    Posted 6 years ago #

    You can do that using multiple loops. Have a look at this.

  3. zota
    Member
    Posted 6 years ago #

    I seem to be having an issue with the new tagging system in 2.3 combined with multiple loops. Is there a way to do this with a single loop?

  4. zota
    Member
    Posted 6 years ago #

    I think I managed to put something together...

    http://wordpress.org/support/topic/99999?replies=5#post-627700

  5. Metlin
    Member
    Posted 6 years ago #

    That actually looks rather neat. Does it use the code that you posted in the other thread?

  6. zota
    Member
    Posted 6 years ago #

    Yeah, it's kludged from some code for assigning a value to each post. It might not be the best way to do it, but it's easy and it's working so far...

  7. Metlin
    Member
    Posted 6 years ago #

    Sure, but it's as good a place to start as any, I guess.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.