WordPress.org

Support

Support » How-To and Troubleshooting » Link for Older/Newer entries not working

Link for Older/Newer entries not working

Viewing 14 replies - 1 through 14 (of 14 total)
  • My apologies for my previous post…

    I have pasted the code now in the pastebin (http://pastebin.com/7y5DhHuk)

    I hope someone can figure out what is wrong in this code, thanks for your help!

    esmi
    Forum Moderator

    @esmi

    Change:

    <?php query_posts("posts_per_page=5"); ?>

    to:

    <?php query_posts($query_string . "posts_per_page=5"); ?>

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

    Thank you esmi, but that didn’t resolve the problem, as now when I replace the code as you proposed and add
    <?php global $query_string; ?>
    before the query_post line as a result the ‘else’ statement of my ‘if’ function kicks-in…do I need to use that variable somewhere else in this loop or?

    OK, I saw I was missing the ampersand before the quoted parameters, but still I do not get the wanted result, now I get the title of the page and meta of that page instead of posts…

    esmi
    Forum Moderator

    @esmi

    Sorry – that should have read <?php query_posts($query_string . "&posts_per_page=5"); ?>

    No problem, as I wrote in my previous post I have figured that out, and now I get the title of the page and meta of that page instead of posts… Do you have any other ideas maybe?

    esmi
    Forum Moderator

    @esmi

    Have you reviewed http://codex.wordpress.org/Function_Reference/query_posts You need to actually tell WP what posts you want.

    Yes I am reviewing it as we speak but as I am new to all this, it takes ma a while to find everything I need, so any hint would be very much appreciated…

    esmi
    Forum Moderator

    @esmi

    I have no idea what posts you want to display…

    well the general idea is to display last five posts, and as I have made all the pages from templates I am using this function to list posts…(or at least I am trying :D)

    esmi
    Forum Moderator

    @esmi

    Were are you using this query? In what template file?

    In a template file for blog homepage which I have defined as follows;

    <?php
    	/*
    		Template Name: citaonica
    	*/
    ?>

    additionally I call-in on this page a sidebar, but the sidebar does not contain any queries…

    esmi
    Forum Moderator

    @esmi

    Is the site configured to use a static front Page? If so, then try using:

    <?php
    $args = array(
    	'post_type' => 'post',
    	'posts_per_page' => 5
    );
    query_posts($args); ?>

    Hi esmi,
    Yes the site is configured to use static front page, but unfortunately the code you suggested does exactly the same thing as my original … 🙁

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Link for Older/Newer entries not working’ is closed to new replies.