WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_posts causes all posts to be the same (1 post)

  1. Nargrakhan
    Member
    Posted 8 years ago #

    I just recently converted my site over to Wordpass from plain 'ole HTML (http://www.elizar.com). I wanted to use the "get_post" for my sidebar boxes. This is one such entry I used:

      <?php $posts = get_posts 'numberposts=20&offset=0&category=2'); foreach($posts as $post) : ?>
    • "><?php the_title(); ?
    • <?php endforeach; ?>

    Everything seems fine after using it, but when I try clicking on the links, it stays stuck on a random post from the selected category. No matter what post I try to call up (or link I hit), the same post always comes up.

    I assume either I'm using the command incorrectly, or my site layout is the problem... but for the life of me, I can't tell which.

    Thanks in advanced for the help.

    ***EDIT***
    Ugh... can't get the script to display correctly.

    Basically, I used the exact first example found at http://codex.wordpress.org/Template_Tags/get_posts but removed the "php the_excerpt" and changed the offset=0 and category=2

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags