The MU forums have moved to WordPress.org

Double listing of posts in treacle (25 posts)

  1. kahless
    Member
    Posted 18 years ago #

    Gang,

    Look at http://jbreitenbuch.blogs.wooster.edu and note the doubling of some posts. What I have noticed is that only posts that are in multiple categories are appearing multiple times. They appear as many times as categories they are in. The code in index.php for treacle is
    <?php get_header(); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="post">

    <?php the_date('','<h2>','</h2>'); ?>

    <h3 id="post-<?php the_ID(); ?>">
    <?php the_title(); ?>
    <span class="edit"><?php edit_post_link(__('edit this post')); ?></span>
    </h3>

    <div class="storycontent">
    <?php the_content(__('[continued...]')); ?>
    </div>

    <p class="meta">
    <?php _e("posted to"); ?> <?php the_category(',') ?> @
    <a href="<?php the_permalink() ?>"
    title="<?php _e('link to') ?><?php the_title() ?>"><?php the_time() ?></a>
    </p>

    <p class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('be the first to comment'), __('be the second to comment'), __('add to the % comments')); ?>
    </p>

    <?php trackback_rdf(); ?>

    <?php comments_template(); // Get comments.php template ?>

    </div>
    <!--end .post-->

    <?php endwhile; else: ?>
    <?php include (TEMPLATEPATH . '/errormessage.php'); ?>
    <?php endif; ?>

    <h4>
    <?php posts_nav_link('','','previous page') ?> |
    <a href="<?php echo get_bloginfo ('url') ?>"><?php _e ('home') ?></a> |
    <?php posts_nav_link('','next page','') ?>
    </h4>

    <?php get_footer(); ?>

    Any reason this would double posts? They are only listed in the manage area once so they are not in the db twice? Thanks.

  2. kahless
    Member
    Posted 18 years ago #

    Actually, I tried several other themes and posts that are in multiple categories show up more than once. What could be wrong?

  3. andrea_r
    Moderator
    Posted 18 years ago #

    That is weird. I've skimmed it and it looks right - even compared to the codex for The Loop. I'd still be inclinded to do some cut n' paste though, just to see.

  4. drmike
    Member
    Posted 18 years ago #

    I'd also double check the Manage Posts page to see if maybe they're in there twice.

  5. kahless
    Member
    Posted 18 years ago #

    Mike,

    That's what the manage area at the end of my post referred to. They are only there once. The only thing they have is multiple categories.

  6. drmike
    Member
    Posted 18 years ago #

    Sorry. Missed that bit. Kind of hettic today since I'm basically off for three days for the holiday. (Everything's closed) :)

    And of course, if I had looked at the page source, I would have noted that the posts have the same number. :)

  7. kahless
    Member
    Posted 18 years ago #

    I can't figure out what is up at all. The loop is correct and the fact that it does it on all the themes I tried makes it pretty clear it is something with the way categories are handled or maybe the db upgrade went wrong somehow?

  8. drmike
    Member
    Posted 18 years ago #

    Here's a thread that might help. Either the addition to the loop call or the issue with php.

    Seems like most of the posts over at wp.org that concern this deal with folks making dupe posts to the forums. :(

  9. kahless
    Member
    Posted 18 years ago #

    Can anyone else confirm this behavior? I just upgraded to r733 and I'm getting the same behavior. The posts are only in the tables once and they have the exact same ID in the doubling. It has to be something about multiple categories or something with the db upgrade when I went from January build to rc4.

  10. kahless
    Member
    Posted 18 years ago #

    Tried $do_not_duplicate = $post->ID; and they are still duplicated. I double checked the tables and the posts are not in the db twice. Here are the tables the blog has

    wp_2_categories
    wp_2_comments
    wp_2_link2cat
    wp_2_linkcategories
    wp_2_links
    wp_2_options
    wp_2_post2cat
    wp_2_postmeta
    wp_2_posts
    wp_2_referer_blacklist
    wp_2_referer_visitLog
    wp_2_sk2_logs
    wp_2_sk2_spams

    link2cat and post2cat seem to be fine. Should linkcategories have been dropped in the upgrade. Could it be causing this?

  11. kahless
    Member
    Posted 18 years ago #

    I am on PHP 5.0.4 and MySQL 4.1.14; could that have anything to do with it.

  12. drmike
    Member
    Posted 18 years ago #

    Kahless, if you want to email me the theme, I'd be happy to give it a shot.

    theapparatus ( at ) gmail ( dot ) com

    I think you said that this was one you were writing yourself.

  13. kahless
    Member
    Posted 18 years ago #

    OK. More info. Newly created blog totally standard theme. If the post is in one category it shows once. If it is in two categories it shows twice. So what is the deal. Should I file a bug? Unless someone else confirms the behavior I don't think I should.

  14. kahless
    Member
    Posted 18 years ago #

    Reproduced on a totally separate install. I have a test server at http://blogs.breitenbucher.net and when I added the last post to a second category it was displayed twice. This server is running on something between r637 and r700 so this has been around a while. The test server was a totally fresh install right before rc1 and was upgraded from there. I'd like it if someone else could verify this behavior. It's great that I can reproduce it on a separate server but who is to say I didn't do the same stupid thing on both? Thanks.

    I can also confirm that making sure the post is only in one category removes the multiple posts.

  15. kahless
    Member
    Posted 18 years ago #

    Most likely place for bug could be in post.php in the get_posts function. Not sure what all is going on in this bad boy but in my search of the code base this is the function that seems to pull the posts.

  16. andrea_r
    Moderator
    Posted 18 years ago #

    I'm running RC4 (not sure where that is in the numbering system) and just tested and can't reproduce that error.

  17. kahless
    Member
    Posted 18 years ago #

    Should post_category in the post table have a value other than 0? Every post in the table has a value of 0 in the post_category column. I can't figure out what I would have done. My upgrade was to download the trunk, copy it to the server, copy over themes, mu-plugins, plugins, favicon.ico, make wp-config.php, and .htaccess. Then I login and run the upgrade. The only hitch is that when I try to access the site that first time all the blogs have been set to spam and mature. I have to run an SQL update on the blogs to change them to not spam and not mature.

    My themes really only have the custom footer stuff and widget support added to some by me. I am not monkeying with the code at all.

  18. kahless
    Member
    Posted 18 years ago #

    Solved!! The culprit is the sideblog plugin. I don't have time to figure out why it causes double posting, but it doesn't play nice with WPMU anymore.

  19. drmike
    Member
    Posted 18 years ago #

    So are we set? Sorry I never got a chance to look at it. With the holiday here in the US, my time is very limited this weekend and I'm having to take tomorrow off.

  20. kahless
    Member
    Posted 18 years ago #

    Yep.

    I have to teach and do my IT gig tomorrow (the school doesn't do the little holidays). Have a relaxing day.

  21. ghmercado
    Member
    Posted 17 years ago #

    Hi I just saw this post and am experiencing same issue after 2.1 upgrade, i posted here.

    i hope kahless can please let me know what sidebar plugin he was referring to.

  22. Ovidiu
    Member
    Posted 17 years ago #

    well I am not sure you are lookign for the right thing here, this is a wpmu forum not wp 2.1 as your post seems to indicate, but I can give you a little hint: I am successfully using the sideblog plugin from http://katesgasis.com/2005/10/24/sideblog VERSION 3.5 - when I tried the version 3.6 which was released to be compatible with wp 2.1 I got severe problems (actually it threw severall mysql errors) so I switched back to 3.5 ...

  23. suleiman
    Member
    Posted 17 years ago #

    Ovidiu, no double posting with this sideblog plugin anymore?

  24. Ovidiu
    Member
    Posted 17 years ago #

    I can't say that for sure as I have posts being either in 1 category (aka the frontpage category) or in 2 categories (frontpage category + sideblog category) so a post either appears on my frontpage only or on the frontpage + sidebar (using sideblog widget)

    I have never had problems with the 3.5 version...

  25. bluegator
    Member
    Posted 17 years ago #

    I know I'm three months late, but double posting is still an issue with the sideblog plugin. If I get some time, maybe I'll muck around and see why, but for now, just deactivate the sideblog plugin if you want posts in multiple categories.

About this Topic

  • Started 18 years ago by kahless
  • Latest reply from bluegator