Support » Fixing WordPress » How-to get post from some number

  • I have a featured first post on an example site
    I want to write the same index.php where the first is featured and another ones begins from second post on the main blog’s page and from 1st on another. Which conditions and functions should I use for that purpose?

Viewing 1 replies (of 1 total)
  • It involves query posts and multiple loops

    http://codex.wordpress.org/Template_Tags/query_posts

    so for example you would use query_posts(‘cat=3’);

    to retrive the newest post from category 3

    also add &posts_per_page=1

    to display just 1 post

    example:

    <?php
    
    //The Query
    query_posts('cat=3&posts_per_page=1');
    
    //The Loop
    if ( have_posts() ) : while ( have_posts() ) : the_post();
     ..
    endwhile; else:
     ..
    endif;
    
    //Reset Query
    wp_reset_query();
    
    ?>

    For featured posts you can use a jquery slideshow

Viewing 1 replies (of 1 total)
  • The topic ‘How-to get post from some number’ is closed to new replies.