• herdhaven

    (@herdhaven)


    I’m trying to setup a page on my blog that will display all the blog entries. I created a template for it:

    http://dpaste.com/535618/

    I went into my dashboard and created the page mydomain.com/all/ and under Page Attributes and Template I selected All Entries. When I go to http://www.mydomain.com/all/ I see only one entry listed and it’s for the page I just created? What have I done wrong? I want it to display all the Post entries, not the Page entries.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    (@alchymyth)

    you need to tell the page template what to show, by adding a custom query before the loop;

    http://codex.wordpress.org/Function_Reference/query_posts

    for instance something like:

    <?php query_posts('posts_per_page=-1'); ?>

    if this does not work, try:

    <?php query_posts('cat=0&posts_per_page=-1'); ?>

    Thread Starter herdhaven

    (@herdhaven)

    ahh, thanks!

    i added:

    <?php query_posts('posts_per_page=10'); ?>

    then at the bottom, outside of the loop, i wanted to paginate the results and added:

    <?php if (  $wp_query->max_num_pages > 1 ) : ?>
    <div class="navigation">
    			<div><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    <?php endif; ?>

    It shows the link for Older Posts, which I know I have, but when I click it and go to /all/page/2/ it displays the same 10 Posts. Do I need to change something in my loop?

    Michael

    (@alchymyth)

    for pagination, you need to add another parameter:

    <?php query_posts('posts_per_page=10&paged=' . get_query_var('page')); ?>

    (it is not quite clear, if get_query_var('page') will work, or if you need to use get_query_var('paged') )

    http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page Displaying the loop not working properly…’ is closed to new replies.