WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PREVIOUS and NEXT post links not working (5 posts)

  1. lonetrotter
    Member
    Posted 7 years ago #

    Hello folks. Sitting here with my Emerson-theme. Just upgraded from 2.0.x to 2.1.3 and I thought I should get rid of my next/previous post problem - but I have not. Its still just keeps the same post even though it shows ".../index.php?paged=2" in the adressfield.

    I have read about thirty posts about it here, but none have helped me. Many seems to solve it disabling plug ins - but I have tried that aswell.

    This is my blog

    I have three seperate pages for three special choosen categorys ([nerderi][svararen][p:lausse])In addition to that there is the ordinary home-page (I have excluded the special cats with "Category Visibility"-plug (and yes - the problem persists if I de activate the plug) and the archive.

  2. lonetrotter
    Member
    Posted 7 years ago #

    Well - at last I fixed it.

    The basics was to replace

    <?php query_posts("cat=xxxx");
         		include (TEMPLATEPATH . '/theloop.php'); ?>

    with

    <?php
        $events_cat = 'xxxx';
    
        if (!is_paged()) {
            query_posts('showposts=yyyy&cat=' . $events_cat);
        } else {
            query_posts('showposts=yyyy&cat=' . $events_cat . '&paged=' . $paged);
        }
    ?>
            <?php include (TEMPLATEPATH . '/theloop.php'); ?>

    Where xxxx is the category that should be shown - and yyyy the amount of posts appearing in the category page.

    Hope it helps someone.

  3. themos
    Member
    Posted 7 years ago #

    You bet it helped!

    Thanks a lot, it was exactly what I've been looking for!

  4. matesl
    Member
    Posted 7 years ago #

    You might also want to try

    <?php query_posts($query_string."&cat=22");?>

    with this you dont need to branch.

  5. ktorktor
    Member
    Posted 6 years ago #

    Thank you lonetrotter! I had the same problem and I've solved it thanks to you. I've changed the cat in category_name in order to use category names with permalinks.

    <?php
    $events_cat = 'xxxx';

    if (!is_paged()) {
    query_posts('showposts=10&category_name=' . $events_cat);
    } else {
    query_posts('showposts=10&category_name=' . $events_cat . '&paged=' . $paged);
    }
    ?>

    <?php include(TEMPLATEPATH."/index.php");?>

Topic Closed

This topic has been closed to new replies.

About this Topic