Support » Themes and Templates » What was changed regarding building the comments?

  • Resolved darkrage64


    Hi guys,

    since my update to 3.4.1 my comments are broken (their style and formatting, not their functionality).

    Avatars have the old “68px” setting in the img-part of the HTML code and some divs that I added between comments etc. are missing.

    When I set up WordPress with version 3.2.1 I used twentyeleven, duplicated it and used this to build my own theme. I changed a lot of things in my theme folder, including comments.php and functions.php.

    Example: In comments.php I added a seperator-line-graphic after <?php // You can start editing here — including this comment! ?>.

    In functions.php in “twentyeleven_comment”, line 513, I changed the size of the avatar to 32, “$avatar_size = 32;” etc.

    All those changes don’t show up in my blog anymore. Even if I add some text it doesn’t show up in the source of the page. It feels like if the files aren’t used anymore to build the comments-html-markup.
    However, for pages like the categories or authors.php, it still works.

    The problem is visible here:

    Another thing that has changed is that before it was “One thought on …” (as it says in my comments.php in my theme folder) and now it’s “One comment on” (and I can’t find this via “find in files”).

    Any help is greatly appreciated!


Viewing 15 replies - 1 through 15 (of 17 total)
  • I changed a lot of things in my theme folder, including comments.php and functions.php.

    Then the issues are probably within your custom theme. Have you checked your site’s error logs. Or turned debug on and enabled error logging?

    Well, with a lot I meant a lot of small changes like adding a div somewhere. Everything is working fine, it’s just that WP somehow doesn’t use the comments and function.php from my theme anymore (and I don’t understand where it’s getting its HTML markup from).

    Nevertheless I’ll try the debug mode etc.

    That’s all I get:

    Notice: add_custom_background is deprecated since version 3.4! Use add_theme_support( 'custom-background', $args ) instead. in /var/www/web1574/html/mimimi_prod/wp-includes/functions.php on line 2628
    Notice: add_custom_image_header is deprecated since version 3.4! Use add_theme_support( 'custom-header', $args ) instead. in /var/www/web1574/html/mimimi_prod/wp-includes/functions.php on line 2628

    What could cause that changes in my comments.php are not visible on my page anymore? It worked well before. And what is WP using instead of my theme file now?

    I guess that somehow my “twentyeleven_comment()” is not used anymore. Because this is the method that involves both the avatar size AND the comments.php changes.

    What happens if you remove or rename twentyeleven_comment() in your functions.php?

    Absolutely nothing. I also tried playing around with the check for the function itself, but nothing changed. Renaming the function.php itself (to make sure that it’s used at all) trashes the site. So somehow the comment method doesn’t get called.

    I read something about changes regarding child themes in the change logs and this term is also used here:

    if ( ! function_exists( 'twentyeleven_comment' ) ) :
     * Template for comments and pingbacks.
     * To override this walker in a child theme without modifying the comments template
     * simply create your own twentyeleven_comment(), and that function will be used instead.
     * Used as a callback by wp_list_comments() for displaying the comments.
     * @since Twenty Eleven 1.0

    Okay, I checked again.

    I am 100% sure that both my comments.php and twentyeleven_comment method are not used at all. Removing my theme’s comments.php from the server has no effect.

    So … as I only updated WP, somehow the connection must be broken or not set up correctly.

    I think WP is using this file instead:
    Does it do this because of the deprecated warnings?

    No, it isn’t. I just can’t find the file it’s using instead …

    My guess is that your theme is using the inbuilt/core comments functionality. That suggest there’s an issue in your theme somewhere relating to comments.

    Does it do this because of the deprecated warnings?

    Nope. Warnings are just that – warnings. The only time WP falls back to using core functionality is when there’s a serious issue in a theme template file or one of its functions.

    My theme is completely using the twentyeleven theme and only changes small parts of it. Nothing related to function calls or similar.

    I never touched scripts outside of the theme folder to be able to update WP without such issues.

    Do you have a tip how I can get it working again? This is really annoying and I don’t know where to search. Usually I do a “Find in files” and search for a specific HTML markup in all source files. But I simply can’t find the file / part that currently generates the comments.

    Why don’t you try creating a child theme of Twenty Eleven and start porting your changes only over to the new child theme?

    I never used the child theme stuff and I don’t want to touch everything again … this would cost a lot of time and therefore money (this is not a hobby page or similar). It just needs to be up and running again.

    As long as I could understand what’s broken it should be easy to fix. Maybe I should open a new thread that starts off with the results we found here, asking how the comments.php from themes are called.

    If you start a new topic now, I can almost guarantee that it will be deleted. It’s really very simple – there’s an issue with your theme’s comments.php or your call to it that is causing WP to fallback to the default core comment functionality.


    – Issue with comments.php:
    No. I replaced the file with the default twentyeleven one. I also did this for the functions.php. Both files can’t be the issue, as this changed nothing. They also never have been touched after the initial setup and the update shouldn’t change them.

    – Where is the “call to it”? How can I check if it is called?
    Even if I put garbage in my comments.php it changes nothing. If I do this with the functions.php the site is down. So functions.php from the theme folder is definitely used, comments.php definitely not.

    – Where exactly is the default core comment functionality located?
    What part of WP generates this snippet?

    <h2 id="comments-title">
     One comment on

    I can’t find it.

    Where is the “call to it”?

    <?php comments_template( '', true ); ?>

    And the code you posted above is, presumably, being generated by your comments.php file.

    This code was generated by my comments.php file in the theme folder. But again, this file isn’t used at all since I updated.

    That’s the broken part that I am trying to find 😉

    So my single.php it looks like this:

    <div id="primary">
    			<div id="content" role="main" class="leftcol">
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php get_template_part( 'content', 'single' ); ?>
    					<?php comments_template( '', true ); ?>
    				<?php endwhile; // end of the loop. ?>
    			</div><!-- #content -->
    		</div><!-- #primary -->

    Removing the <?php comments_template( ”, true ); ?> call removes all the comments, so this seems to be the right direction …

    Okay, echoing the address the $file is using shows me that there’s a plugin that is overwriting my comments.php-link.

    I still need to check if this was always the case or maybe it was related to updating the specific plugin. Very annoying.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘What was changed regarding building the comments?’ is closed to new replies.