Support » Plugins » Hacks » Problem with the loop

  • alexborras

    (@alexborras)


    I am using this code to see a list of post titles:

    query_posts("cat=7&showposts=10");
    ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    <?php endwhile;?>
    </ul>
    <?php

    the result is correct:
    * Post 1
    * Post 2
    * …
    but after seeing the list is again the full content of the Post:
    Post 1
    Text of Post 1 …
    Post 2
    Text of Post 2 …

    Is there a way to view only the list of the titles of the Post?

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you’re seeing content it’s not the result of the code you have above, there’s nothing in that code that would output the post content.

    alexborras

    (@alexborras)

    OK, thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with the loop’ is closed to new replies.