I have the following problem: I have to create a posts archive into a static page. So I have created this page template containing the loop to interate on my posts:


 * Template Name: Posts Archive
 * A custom page template for displaying all posts.
 * The "Template Name:" bit above allows this to be selectable
 * from a dropdown menu on the edit page screen.
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0


<!-- Contenuti (griglia) -->
<div class="container">
    <!-- Lead presentazione -->
    <section id="presentazione">
        <div class="row">
            <div class="col-sm-12">
                <!--<h1 class="text-center"><small>Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</small></h1>-->
                <h1 class="text-center title">Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</h1>
                <h1 class="text-center leadTitle">Association in Defense of the Human Rights of the Eritrean People</h1>
                <p class="lead text-center">
                Association in Defense of the Human Rights of the Eritrean People
            </div><!-- /.col-sm-12 -->
        </div><!-- /.row -->
    </section><!-- /section presentazione -->
    <!-- Progetti in evidenza -->

    <header class="header-sezione">
        <h2>Archivio post</h2>

    if (have_posts()) :
        // Start the Loop.
        while (have_posts()) : the_post();

             * Include the post format-specific template for the content. If you want to
             * use this in a child theme, then include a file called called content-___.php
             * (where ___ is the post format) and that will be used instead.
            get_template_part('contentArchive', get_post_format());

    else :
        // If no content, include the "No posts found" template.
        get_template_part('content', 'none');



<?php get_footer(); ?>

Thene I then created a new page using the Wordpress Admin system with a title of "All Posts" and selected the "All Posts" template from the drop-down. Didn't need to enter anything in the body.

If you open this link you can see my problem: http://lnx.asper-eritrea.com/archivio/

The problem is that it don't show the posts list but this list contains only a single element that is the current page.

It seems to me (correct me if I am saying wrong things) that if I insert a loop into a static page the iterated list is not a list of post but a list that contains the current static page referer? Is it true?

So what can I do to obtain the entire posts list into a static page? Have I to specify a new query? Or what? How can I do it?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.