Support » Fixing WordPress » Can’t get offset to work on archive page

  • I’m having a hard time getting the offset to work on my archive.php page. Everything else works fine except for that. What I want to do is display a list of “more” posts in that category when you are on a category page in the sidebar.

    Here’s my code:

    			global $post;
    			$categories = get_the_category();
    			$category = $categories[0];
    			$cat_ID = $category->cat_ID;
    			$myposts = get_posts("numberposts=40&offset=20&category=$cat_ID");
    			<?php while (have_posts()) : the_post(); ?>
    			<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    			<?php endwhile; ?>

    It seems like it just totally ignores the offset and I can’t figure out another way to do it.


  • The topic ‘Can’t get offset to work on archive page’ is closed to new replies.