WordPress.org

Ready to get started?Download WordPress

Forums

Trying to displaying posts in two different formats (1 post)

  1. blaue
    Member
    Posted 6 years ago #

    I'm working on my index.php page and trying to get the first 7 posts as full post info as in the_content() and then display 10 older posts just as excerpts. I have it working perfectly until I go to /page/2 then the bottom excerpt post stay the same and the top full posts change with the page.

    This is the code I'm using to display the bottom 10 except posts.

    <?php
                 global $post;
                 $myposts = get_posts('numberposts=10&offset=7');
                 foreach($myposts as $post) :
                 setup_postdata($post);
                 ?>
                    <li>
                 <a href="<?php the_permalink(); ?>">
                 <h3><?php the_title(); ?></h3>
                 <?php the_excerpt(); ?>
                 </a>
                 </li>
                 <?php endforeach; ?>

    I think the solution is to get the page info connected to the get_post but I have look and have no idea how. I would be grateful for any help.

Topic Closed

This topic has been closed to new replies.

About this Topic