• I am trying to show a list of recent ‘the_excerpt’ on my blog page and want to show them below a ‘the_post’ at the top. So far I just copied and pasted the string and it works fine.

    Though, I don’t want the 2nd string to show the first blog. Just the 2nd and on.

    How to I begin the excerpts starting on the 2nd blog?

Viewing 4 replies - 1 through 4 (of 4 total)
  • you could use the ‘offset’ parameter – however, that would break any pagination.
    better to use the ‘do_not_duplicate’ method described in https://codex.www.ads-software.com/The_Loop#Multiple_Loops_in_Action

    or even better to use one of the ‘how to style the latest post different’ methods, using a counter, for instance:
    https://www.ads-software.com/support/topic/different-styling-for-the-first-post?replies=2
    if you change the conditional statement to:
    if( $counter == 1 && !is_paged() ) :
    you can distinguish between the front page and paginated pages, and don’t get into trouble with posts_per_page numbers.

    Thread Starter jeremyhawes

    (@jeremyhawes)

    I must be missing something as I’ve tried all these no with no luck, but it’s clear I’m writing something in my page the wrong way. I wish I had a live example.

    Here’s an example of some of my code, very basic I believe. I’m trying to locate where to insert this to start on the 2nd post. I believe seeing this in the code would help me tremendously if possible.

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    	<h1><a href="<?php the_permalink() ?>">
    	<?php the_title(); ?></a></h1>
    	<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    	<div class="entry"><?php the_excerpt(); ?></div>
    </div>

    what about if you paste the full code of your template file into a https://pastebin.com/ and post the link to it here?

    if you want to use your code section, try:

    <?php global $query_string; query_posts( $query_string . '&offset=1' );
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    	<h1><a href="<?php the_permalink() ?>">
    	<?php the_title(); ?></a></h1>
    	<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    	<div class="entry"><?php the_excerpt(); ?></div>
    </div>

    https://codex.www.ads-software.com/Function_Reference/query_posts
    https://codex.www.ads-software.com/Function_Reference/query_posts#Usage_Note

    Thread Starter jeremyhawes

    (@jeremyhawes)

    That worked right there actually.

    Thanks a bunch on that! Saved me a gigantic amount of time ??

    I really do need to just buckle down and learn more too.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘? How to query_posts to start on 2nd Post ?’ is closed to new replies.