• I’ve played around the page that displays my posts. At the moment it only displays posts from a particular category, but I now want to change it to display posts for all categories, and have pagination.

    Here’s my current code:

    <?php  
    
                /* This is the new loop to display a featured story.
                 * It creates a variable and then loads all the posts that match the query.
                 */
    
    $my_query = new WP_Query('category_name=Advice&showposts=10');
    $do_not_duplicate = $post->ID;
                /* Now it loops through the results and displays the content.
                 */
    
    while ($my_query->have_posts()) : $my_query->the_post(); 
    
                /* Then it displays the title as a working link with formatting to
                 * match the Twenty Ten template.
                 * Then we display the excerpt.
                 * Then we finish the loop with the endwhile statement
                 */
    ?>

    What do I need to change

  • The topic ‘Return posts page to show posts from all categories’ is closed to new replies.