• Hello,
    I want to show all posts in one page.
    So I create a page template and I put in it the following code:

    <?php
    /*
    Template Name: All posts
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php if(have_posts()) : ?>
         <?php while(have_posts()) : the_post(); ?>
    
                   <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                   <div class="entry">
                        <?php the_content(); ?>
                  </div>
    
         <?php endwhile; ?>
    <?php endif; ?>
    
    <?php get_footer(); ?>

    But when I chose this page template in some random page, it’s not showing me the last posts, it’s not showing me nothing actually.

    Any help?

    Thanks!

  • The topic ‘Why this is not working?’ is closed to new replies.