WordPress.org

Ready to get started?Download WordPress

Forums

Show # of recent posts that aren't "hidden" (1 post)

  1. jackilyn
    Member
    Posted 7 years ago #

    I've been trying to figure this out all night. Basically what I want to do is list the 4 most recent poss except the first one AND not include asides in those. I got it to work, for the most part, but it doesn't show 4. It takes the 4 posts, looks at them, and only displays it if it's not an aside or the first post. Here's my code


    <?php $posts = get_posts('numberposts=4'); foreach ($posts as $post): ?>
    <?php if ( !(in_category(4) || ($first_post == $post->ID)) ) { ?>

  2. <h3>"><?php the_title() ?></h3>
    <p><?php the_time('d M Y'); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    Filed under <?php the_category(', '); ?>.</p>
  3. <?php } endforeach?>

    If anyone has any suggestions or links I'd be very grateful. Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags