Comments not appearing in sidebar

  • kipper1960


    As per Simons fix on a recent post I cannot get comments to appear in my sidebar widget, I looked in this loop.php file and cannot see the wording

    <?php /* Get the comments template for single post pages */ ?>
    <?php /* if (is_single() || is_page()) {comments_template();} */ ?>

    Do I need to add this and if so where do I put it etc, or is there another fix to get them to display.



    1. Moved to support. Please post in the correct section next time.

    2. Put your code between backticks. It is located above the Tab key on a standard keyboard. I’ve corrected your post.

    3. Add a link to your site while asking questions. It helps for a better diagnosis.

    Please explain what you are doing/expecting. If you want to show recent posts on sidebar, you can just use Recent Posts widget.



    Ok, as I mentioned in the original post I am trying to get the comments to appear in the sidebar widget but they do not appear, I have tried with the above code but I dont know were to actually put this, I have used the code plus the backticks right at the start of the loop.php code but it did not work, my site is


    Kenneth John Odle


    The code above is PHP. You can’t just drop that into a text widget, because text widgets can only parse text, HTML, and CSS.

    You will need to use the PHP Widget plugin. You can find out more about that here:

    Keep in mind that the code you give above will only display the comments for the particular post or page it is appearing on. If you want to show all recent comments from all posts, just use WP’s built in “Recent Comments” widget.



    The WP plugin Recent Comments is what I have used but no comments appear, It just doesn’t work, I never said I was dropping code into a text widget, I understand that.

    All I’m trying to get is when someone comments on my page that the comments appear on the sidebar but at the moment for the life of me nothing works


    Kenneth John Odle


    Post a link to your site and I’ll take a look.

    Duh, I already looked at your site.

    Ignore this; it’s must be an aftereffect of the cold medicine I’m taking.


    Kenneth John Odle


    Also, what do you have set for “Number of comments to show:” in the Recent Comments widget? How many comments do you actually have on your site? (There may be a bug in which the plugin won’t display any comments if you have fewer comments than you are asking it to display.)

    I just checked your site and left a comment. Go ahead and approve it (you can delete it later) and see if it shows up in the recent comments plugin.



    Ok, I have the number of comments set to 5, I have approved your comment which make 2 toatl for my site at the moment, the comments do not show up on my main page in the recent comments widget.

    As you said maybe theres a bug etc – should I try downloading another plugin etc and try.

    Thanks for looking into this – hopefully I can get it to work


    Kenneth John Odle


    Nope, just try setting the plugin to display 2 comments and see what happens. This plugin does work — I use it on my book blog.



    I tried setting it to 2 and still no comments appear – just about got me stumped!!

Viewing 10 posts - 1 through 10 (of 15 total)

  • 1
  • 2
  • You must be logged in to reply to this topic.