Forums

PAGINATE TEMPLATE (4 posts)

  1. Nasgor
    Member
    Posted 1 year ago #

    Hello.
    I'm using WordPress 3.0.5. with a child theme of Twenty Ten (created by me) installed, it has not many modifications to the original. I created a template to display a history of my posts in a page. Everything seems to work correctly, but I dont know how to paginate it. I would love to show in 50 posts groups whith the pagination at the end. Any body could hel me?

    I leave the code that I have prepared below.

    http://wordpress.pastebin.com/WYskqsLw

    Thank you very much.
    Nasgor
    [sig moderated as per the Forum Rules]

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

    Why are you querying the database directly

    <?php
    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
    if (0 < $numposts) $numposts = number_format($numposts);
    ?>

    instead of using query_posts?

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

  3. Nasgor
    Member
    Posted 1 year ago #

    That was a code I found online and modified. That's why the code was with that format. But I've improved it. Even so, I still do not know how pageinate the results in the template. If anyone can help me or give me a hint I'd appreciate it very much.

    Here is the code.

    http://wordpress.pastebin.com/CjKsKhZw
    Thank you very much.
    Nasgor
    [sig moderated as per the Forum Rules]

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

    See the link I gave above.

Topic Closed

This topic has been closed to new replies.

About this Topic