• Hi Guys,

    I’ve created a Page and named “Related Pages” and I want to list all my post inside the page with “Title” as a list. When there is a new post it will automatically add to the list of “Related Pages” area.

    How can I do that?
    I don’t want to use plugin if possible but if there is no way, please suggest.

    Please help guys!

    Thanks

    Ben

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter benowats

    (@benowats)

    Fix done,

    Got this code :
    <?php
    /*
    Template Name: All posts
    */
    ?>

    <?php
    $debut = 0; //The first article to be displayed
    ?>
    <?php while(have_posts()) : the_post(); ?>
    <h2><?php the_title(); ?></h2>

      <?php
      $myposts = get_posts(‘numberposts=-1&offset=$debut’);
      foreach($myposts as $post) :
      ?>

    • “><?php the_title(); ?>
    • <?php endforeach; ?>

    <?php endwhile; ?>

    Hope this help to others! ??

    What if someone only wants to display posts from a specific category. Will this code work?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to list a post inside the page?’ is closed to new replies.