WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] I dont find in the loop what i want, please help-me.

[Resolved] I dont find in the loop what i want, please help-me.

  • For first, sorry about my english.
    I extensive read http://codex.wordpress.org/The_Loop article, and i dont find what i need, maybe i’m reading the wrong article, but, there it goes.

    i use the follow code to show the newest post from a specify category
    <?php $posts = get_posts( “category=6&numberposts=1” ); ?>
    <?php if( $posts ) : ?>
    <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
    but now, i want to show only the third post(2 posts behind the newest), and i dont know what i have to include in this code. If someone could help-me i’m very very glad.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Look at the offset parameter of get_posts:

    Template_Tags/get_posts

    Hey MichaelH thank u very very much. i’m looking on the wrong place.
    For everyone who has the same doubt, i just added the argument offset=2.
    the code
    <?php $posts = get_posts( “category=6&numberposts=1&offset=2” ); ?>
    <?php if( $posts ) : ?>
    <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] I dont find in the loop what i want, please help-me.’ is closed to new replies.