WordPress.org

Forums

[resolved] Headline view - query post (4 posts)

  1. callender
    Member
    Posted 4 years ago #

    Hi there,

    I want to show summary for the first news item, followed by the 3 latest.

    So latest in full summary, and following 3 as titles only - currently using the following code. However it is repeating the first news item in the archive list.

    How do i code the php so it misses the first news item from the archive list?

    <?php query_posts('showposts=1'); ?>
    						<div class="postmetadata">Posted on <?php the_time('j F Y') ?></div>
    					<?php while (have_posts()) : the_post(); ?>
    					<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    					<li><?php the_excerpt(__('(moreā€¦)')); ?></li>
    					<?php endwhile;?>
    				</ul>
    					<ul class="archive">
    						<?php get_archives('postbypost', '3', 'custom', '<li>', '</li>'); ?>
    					</ul>
  2. callender
    Member
    Posted 4 years ago #

    any ideas? thank you

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

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

    this seems to cover pretty much exactly what you are after, rather than get_archives

    as an aside, get_archives is deprecated, should use wp_get_archives

  4. callender
    Member
    Posted 4 years ago #

    thanks Rev.

Topic Closed

This topic has been closed to new replies.

About this Topic