WordPress.org

Support

Support » How-To and Troubleshooting » Show # of recent posts that aren’t “hidden”

Show # of recent posts that aren’t “hidden”

  • 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)) ) { ?>

  • <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>

  • <?php } endforeach?>

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

  • The topic ‘Show # of recent posts that aren’t “hidden”’ is closed to new replies.
Skip to toolbar