WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pagination on categories page with pagination.php function (5 posts)

  1. emanuelme
    Member
    Posted 3 years ago #

    I have set up a wordpress site that uses Ultra Business WordPress Theme. It has a built in pagination.php
    The problem I am having is that I set up the blog page to call up just a particular category and pagination isnt working there.
    Here is a link to the page;
    http://bethmichelle.com/?page_id=79
    When you click page 2 on the bottom, it returns to page 1. How can I manipulate pagination to work for the categories?

    Here is the code from the blog-template.php;

    <?php
    //Pagination
    if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?>

    and here is the code from the pagination.php function;

    [code moderated - please use the pastebin]

    I don't know too much about coding, but i should be able to follow. Note, that it does work on the archive page here
    http://bethmichelle.com/?m=201103

    thanks!!!

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    I set up the blog page to call up just a particular category and pagination isnt working there.

    check that your query contains the 'paged' parameter for pagination:

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

  3. emanuelme
    Member
    Posted 3 years ago #

    I have
    <?php query_posts('category_name=blog'); ?>
    in the blog-template.php

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    try:

    <?php query_posts('category_name=blog&paged=' . get_query_var('paged')); ?>

    if that does not work, try:

    <?php query_posts('category_name=blog&paged=' . get_query_var('page')); ?>

    or:

    <?php global $query_string; query_posts($query_string .'&category_name=blog'); ?>

  5. emanuelme
    Member
    Posted 3 years ago #

    The first one worked like a charm.
    <?php query_posts('category_name=blog&paged=' . get_query_var('paged')); ?>
    Thanks so much for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic