WordPress.org

Ready to get started?Download WordPress

Forums

multiplying categories (8 posts)

  1. TechGnome
    Moderator
    Posted 9 years ago #

    Can you post a link to your index.php file saved as a .txt file? I'm curious as to see what you did. I have a suspision, but I want to wait to see how your file is laid out first.
    TG

  2. TechGnome
    Moderator
    Posted 9 years ago #

    Hey, I'll be honest.... I'm completely stumped. It looks like there is something in the call to the the_category() function that's causing the categories to print multiple times. Coupled with the fact that they are all separated by commas as opposed to "cat1, cat2 cat1, cat" that the function thinks it's doing it right.
    What makes it eve weirder, is that in the archives and single post and comments views, it all looks right! Gah! I have no freekin' clue.
    Sorry I couldn't be of any more help. Short of tearing apart wp-blog-header.php or template-functions-category.php and combing through it for any thing, I don't know what else.
    TG

  3. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    update_post_caches() is called for both loops. Posts present in both loops will have their category list stuck in the category cache twice. It's a bug. I'll fix it tomorrow.

  4. akb
    Member
    Posted 9 years ago #

    Actually, if you check the output from the second get_posts loop, you will notice that the first 3 items are repeating three times. I suspect it is because the default number of posts per page is set to 10. I have no idea what the update_post_caches() might do, but there seem to be three loops, not just the two that are displayed on this page.
    1 - the default loop (set to 10)
    2 - the first get_posts loop (with date, title, excerpt, categories, etc) (set to 3)
    3 - the second get_posts loop (with just title, date & categories) (set to 15, but I only have 14)

  5. akb
    Member
    Posted 9 years ago #

    Uh, did this issue get addressed last week? I d-loaded the Mon, Oct 25 nightly and installed it in a separate directory, but it is doing the same thing. If it was addressed, it was not fixed. If it was not addressed, is there any further time-table for it?

  6. akb
    Member
    Posted 9 years ago #

    Does anyone know if the update_post_caches() was somehow changed to let two get_posts co-exist on the same page? If not, could this be worked around by off-loading each loop into an include file or would that still double (or triple) the category entries?

  7. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    It still needs to be fixed. I've been preoccupied. Anyone else can feel free to fix it and send a patch. You don't have to wait on me. ;-)

  8. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    Fixed in CVS thanks to some help from the hackers list.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.