WordPress.org

Ready to get started?Download WordPress

Forums

Link for Older/Newer entries not working (15 posts)

  1. vlv
    Member
    Posted 1 year ago #

    Hi,
    Can someone please help me with this problem, I can click the links and new page opens but the content is the same again...

    Here is the code, if someone could please tell me where is my mistake that would be really great...

    [code moderated - the forum limit for posting code is 10 lines - please use the pastebin for anyting above that]

    [no bumping please]

  2. vlv
    Member
    Posted 1 year ago #

    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!

  3. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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

  4. vlv
    Member
    Posted 1 year ago #

    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?

  5. vlv
    Member
    Posted 1 year ago #

    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...

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  7. vlv
    Member
    Posted 1 year ago #

    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?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  9. vlv
    Member
    Posted 1 year ago #

    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...

  10. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    I have no idea what posts you want to display...

  11. vlv
    Member
    Posted 1 year ago #

    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)

  12. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  13. vlv
    Member
    Posted 1 year ago #

    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...

  14. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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); ?>
  15. vlv
    Member
    Posted 1 year ago #

    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 ... :(

Topic Closed

This topic has been closed to new replies.

About this Topic