• Resolved WayneSmallman

    (@waynesmallman)


    I’ve found WordPress to be particularly weird / inflexible when it comes to arranging different elements, like comments, categories etc.

    This has been the case with my company blog, where (because of the design) the sidebar needed to be called before the comments, within the template.

    This caused no end of problems because this arrangement broke just about every dynamic element associated with a post page.

    I’ve since figured out a fix:

    <?php $postID = $post->ID; ?>

    Call the sidebar.

    <?php $post->ID = $postID; ?>

    Call the comments.

    But after updating to 2.8 the problem has returned, albeit in a reduced form.

    I’m now seeing the right comments for a post, but it’s displaying the wrong comment title.

    For example, a post page title like: “Of projects, payment and planning” would have the comments title: “Octane, 1999-2009: the first 10 years”, which is a previous post title.

    There’s no discernible order to how WordPress selects these titles. The order would appear to be completely random.

    How do I force WordPress to display the right title for the comments?

Viewing 1 replies (of 1 total)
  • Thread Starter WayneSmallman

    (@waynesmallman)

    If you’re having the same problem as me, instead of using:

    <?php the_title(); ?>

    Use:

    <?php single_post_title(); ?>

    I’m not sure why there should be different functions that look to perform the same kind of actions but vary in subtle and confusing ways, but this works.

    Now fixed.

Viewing 1 replies (of 1 total)
  • The topic ‘Right comments. Wrong comment title’ is closed to new replies.