• Is it possible to set a css class specific to the last post returned with the get_post function? We have our ui li tags setup with a horizontal bar dividing each post. Without being able to set a class specific to the last post returned we end up with an unwanted horizontal

    <ul>
    <?php
    global $post;
    $args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => 1 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

The topic ‘Set class for get_post’ is closed to new replies.