How to change default Comments and No Comments location in WordPress in wordpress default theme

For a number of time I’ve been planning to change my blog comments placement. Until this very day however I’ve kept the default wordpress theme’s Comments button placement.

I realize the default Comments button placement is a bit hard to see and not that much intuitive for the user that enters my blog for a first time.

My first guess was that there might be somewhere a wordpress plugin which will allow me to adjust my comments button placement.
After some research online and a realization that probably there is no such plugin existing yet. I’ve forced myself to tune it up myself.

It was clear to me that in order to change the it will be necessery to edit the WordPress templates files. I’m not a designer and when I hear about templates I usually get scared, however I took the time to take a look at the default wordpress template and find out actually that template modifications is actually rather easier than I thought.

My previous idea was that in order to edit templates you have to be some kind of CSS and HTML guru (which I’m not). Nevertheless it seems that in order to play and adjust in a good way the templates you don’t need ot be a pro.
Even an uneducated fool like myself can easily do almost everything he thinks of throughout few lines of code in the wp templates.

To get back to the major topic thanks God after a bit of review and reading of wordpress.org documentation and some user forums. I’ve figured out that in order to change my Comments placement you need to modify the file:
 

  • blog/wp-content/themes/default/index.php

In index.php find the line starting with:

You will notice within this opened paragraph the php code:

<?php the_tags('Tags: ', ', ', '
'); ?> Posted in <?php the_category(', ') ?>
| <?php edit_post_link('Edit', '', ' | '); ?>
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

This is the actual default theme php code that makes the wordpress Comments or No Comments that maes the comments appear on the blog.

Now I’ve decided to let this be as it is but add one more Comment button to wordpress on a different location that is more appealing to my blog visitors

After quick evaluation I’ve determined that probably the best location that the Comments button should have is right after the end of the post text

If you think my idea for button placement is appropriate, to set this location for the Comments button, you will have to find the follwoing code in index.php:

<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>

Right after the end of this code place the following code:

<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
</div>

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

4 Responses to “How to change default Comments and No Comments location in WordPress in wordpress default theme”

  1. Dịch Vụ Thám Tử Nhanh Chính Xác Bảo Mật says:
    Firefox 2.0.0.14 Firefox 2.0.0.14 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

    hey there and thank you to your info ? I have definitely picked up anything new from right here. I did on the other hand experience some technical points the usage of this website, as I skilled to reload the website lots of times prior to I could get it to load correctly. I had been puzzling over in case your web hosting is OK? Not that I am complaining, but sluggish loading cases occasions will sometimes have an effect on your placement in google and could damage your quality ranking if ads and marketing with Adwords. Anyway I’m including this RSS to my e-mail and could look out for much more of your respective fascinating content. Ensure that you replace this once more soon..

    View CommentView Comment
  2. Richie says:
    Firefox 3.5.3 Firefox 3.5.3 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    I really like reading your website. May I ask you a question. I think that you have a lot of visitors daily but why your website is loading so fast? What kind of hosting you are using? I heard hostgator is good but its price is quite high for me. Thanks in advance.

    View CommentView Comment
  3. hostgator coupon code domain name says:
    Internet Explorer 9.0 Internet Explorer 9.0 Windows Vista Windows Vista
    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)

    These are truly enormous ideas in about blogging.

    You have touched some pleasant things here. Any way keep up wrinting.

    View CommentView Comment

Leave a Reply

CommentLuv badge