Forums

Only show the posts for the current category with get posts (1 post)

  1. diskultur
    Member
    Posted 2 years ago #

    Hi !,

    I want to only show the posts for the current category archive page, I have this code :

    <?php for ($i = 1; $i <= 50; $i++): ?>
            <?php $lastposts = get_posts('numberposts=1&offset='.($i-1));
            foreach($lastposts as $post) :
            setup_postdata($post);
    	?>

    Anyone could tell me what should I change in this code to show the posts for the current category page

    I think there's something with "if is_category" functions but I don't know how to use it !

    It would be very appreciated if someone could help me :p

    Thanks !

Topic Closed

This topic has been closed to new replies.

About this Topic