WordPress.org

Ready to get started?Download WordPress

Forums

Help with category posts page/pagination (3 posts)

  1. Labb1
    Member
    Posted 2 years ago #

    Hi all,

    I've got this code on my website (www.metal-exposure.com) (see below)to get my category posts Interview to show up on the Interview page. It works fine.

    <?php
    $catID = 0;
    if (is_page('Interviews')) {
    $catID=232;
    }
    if ($catID) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=$catID&paged=$paged");
    }?>

    However, it shows 5 posts because of the general WordPress settings (The category contains 6 posts . Can I change this amount (specificly for this category) or how do I get pagination working so that people can browse to earlier posts?
    I hope anyone can help me out, I'm not much of a hero when it comes to those codes. Or if there is a simpler solution, that would be fine to!

  2. peter achutha
    Member
    Posted 2 years ago #

    Is it always 1 less?

    Tell it to display +1 posts as total post to display. I am not sure of your program and am very new to PHP but I think you could change it to

    $paged = (get_query_var('paged')) ? get_query_var('paged') +1 : 1;

    if it is always 1 less then the total posts in the category.

    Would this work?

  3. Labb1
    Member
    Posted 2 years ago #

    Nope, doesn't work.

Topic Closed

This topic has been closed to new replies.

About this Topic