WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Navigation when excluding category broken in 3.1 (5 posts)

  1. jhkb
    Member
    Posted 3 years ago #

    Hi all, after hours of searching I haven't found a solution that will fix this for me.

    My local version using 3.0 works perfectly with this code:

    <?php if ( is_home() ) {
    query_posts($query_string . '&cat=-3');
    }
    ?>

    ...but with the live 3.1 version the category is excluded but the next_posts_link only refreshes the first page of posts. I've tried lots of different methods of querying the posts including pagination (which seemed to fix the problem for almost every thread I read).

    Is this a problem specific to 3.1 that I've missed?

    http://www.jhkbdesign.co.uk/blog/

    Thanks in advance!
    Jess

  2. jhkb
    Member
    Posted 3 years ago #

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name=Uncategorized&posts_per_page=5&paged=' . $paged); ?>

    Just tried this and no luck either - it's definitely excluding the right category, just not paging right. Any clues?

    I can paste my entire index page if this helps...

  3. jhkb
    Member
    Posted 3 years ago #

    Here goes:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Since the last post i've tried suggestions to use wp_reset_query - so those are still in there. I'm at a loss...

    Edit: I also have a few 'mini-loops', a list of latest posts in my footer and a list of all posts from the excluded category in the sidebar. Not sure if these are causing the problem as they are also on the local version, which is working properly.

  4. jhkb
    Member
    Posted 3 years ago #

    Sorry to go on but am I missing something really obvious here?

    Any help would be really appreciated!

    Jess :)

  5. jhkb
    Member
    Posted 3 years ago #

    *facepalm* for anyone as silly as me, and to resolve this lonely thread, my permalink structure was set to numeric - I set a custom of /archives/%postname% and it worked.

    My host suggested this after I queried a conflict in versions of MySQL, they also claimed to have changed something in my .htaccess file which might have made a difference.

    Oh well - it works!

Topic Closed

This topic has been closed to new replies.

About this Topic