Forums

How do I change "0 Comments" to "Leave a Comment"? (33 posts)

  1. Thedishmaster
    Member
    Posted 8 months ago #

    I changed the code in my template to make "0 Comments" change to "Leave a Comment" but it is not showing up on the home page If you click on a post you can see that my code takes effect, yet the home page won't show it. I've been told by another coder that unless the tags are blatantly specified in the wp-loop.php file, the home page won't show it. The only problem is that I cannot figure out what to precisely specify to make this appear. My site is:

    http://www.TheDishmaster.com

    and for an example of an individual post where you can see the code take effect, go to:

    http://thedishmaster.com/2011/09/happy-labor-day-dishmaster-vacation.html

    Help is much appreciated!

  2. dsortax
    Member
    Posted 8 months ago #

    do a search in each .php files of your theme for "0 Comments"(like the one you changed) and change em ALL to "Leave a Comment"

  3. Thedishmaster
    Member
    Posted 8 months ago #

    I did this and it worked, but it only works when you click on an individual post. The home page won't allow it, because unless it's specified to appear in the home page, it won't show up there. I just don't know what to specify because I can't code.

  4. dsortax
    Member
    Posted 8 months ago #

    hmm maybe the code is different in the index.php or page.php for some reasons.

  5. Thedishmaster
    Member
    Posted 8 months ago #

    I'm not sure why it works this way but I could not even center videos without specifying the center tag in the wp-loop.php file, which allowed for something to be centered on the home page. It's the same issues with the comments, except I'm not sure what to specify.

  6. dsortax
    Member
    Posted 8 months ago #

    Im sorry i cannot help you.. im used with simple themes that are easy to handle with. Yours seems to be too much complicated for me.

  7. Aminiis
    Member
    Posted 8 months ago #

    In you index.php you can see the code like:

    <?php get_template_part('content'); ?>

    this code call content.php file. Now you check your index.php and see which file you have in your index.php. Open that file and see this block of code:

    <?php comments_popup_link(esc_html__('0 comments','Chameleon'), esc_html__('1 comment','Chameleon'), '% '.esc_html__('comments','Chameleon')); ?>

    Now change 0 comments to Leave a comment.

  8. alchymyth
    The Sweeper
    Posted 8 months ago #

    it shows as 'leave a reply' on the front page, only to be changed a fraction of a second later to '0 comments', probably by javascript, maybe by the disqus plugin?

  9. Thedishmaster
    Member
    Posted 8 months ago #

    I don't see anything similar to that code in the index.php file. I'm pretty sure the issue is that the home page will not allow for that code unless it's directly specified. I just don't know what tag to specify. It's in the wp-loop.php file and here is the code.

    <?php the_excerpt_reloaded(1000, '<h3>,<h4>,<a>,<img>,<p>,
    <ul>,
    <ol>,<small>,<h2>,
    <li>,, <center>, </tr>, </tbody>, <tbody>, <script>, <strong>, <td>, <tr>, <em>, <table>, <embed>, <iframe>', 'content', TRUE, 'Continue Reading', FALSE, 2); ?><br />
                            <?php } ?><br />
    					</div></p>

    <p>Those are all of the tags I've specified so that the home page displays it. Again, if you click on the link for an individual post it correctly says, "leave a comment" -- it just doesn't display this on the home page.

  10. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    Thedishmaster - You need to wrap your code in CODE tags. I've tried to fix it... I don't think I did.

  11. Thedishmaster
    Member
    Posted 8 months ago #

    Do you where to insert those tags exactly? Can you tell me where to specifically put them?

  12. alchymyth
    The Sweeper
    Posted 8 months ago #

    the browser gets this html code from the site:

    <span class="dsq-postid" rel="7171 http://thedishmaster.com/?p=7171">Leave a Comment</span>

    as you can see, it has 'Leave a Comment' as text -
    but, some javascript is changing this immideately to '0 Comments'

    my suspicion is that the disqus plugin is causing this; have you checked if there is an option or setting in the plugin to change the text?

  13. Thedishmaster
    Member
    Posted 8 months ago #

    It is not the plugin. It's the fact that any tag that is not specified to appear in the home page will be filtered out. Again, if you click on the title of a post itself, you will see that it says "leave a comment" and not "0 comments." It's because it just won't appear on the home page but it will appear on the individual post.

  14. Thedishmaster
    Member
    Posted 8 months ago #

    BTW I appreciate your help. It's one of those little things that is driving me nuts, and I wish I could figure out. I really do appreciate your effort.

  15. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    Thedishmaster - Look above the reply box that you type in.

    See how it says B, I, link, b-quote, code, ol, ul, li?

    Click on CODE ;) (Also if you read below the box, it tells you how to put code in)

  16. Thedishmaster
    Member
    Posted 8 months ago #

    Okay -- my apologies for being confused here. I'm looking to have my home page read as "leave a comment" instead of 0 comments. Are you telling me to insert code tags into the template itself? And if so, where in the template would I insert it?

  17. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    No, I'm telling you when you paste code HERE on these forums, you need to use code tags or it mangles the output and no one can see what you mean to show :)

    Look at your post here: http://wordpress.org/support/topic/how-do-i-change-0-comments-to-leave-a-comment-1?replies=16#post-2321438

    See how the code probably doesn't look like what you saw? That's because you didn't use code tags on the forums. I Attempted to fix it, but some of the HTML was rendered by the forums so it's a little goobered.

  18. Thedishmaster
    Member
    Posted 8 months ago #

    got it!!!! Now I understand. Thanks so much! Hope that works below

    <div class="post-entry">
                        	<?php if(is_page() || is_single()) { ?>
    						<?php the_content('Continue Reading &raquo;'); ?>
                            <?php } else { ?>
                            <?php the_excerpt_reloaded(1000, '<h3>,<h4>,<a>,<img>,<p>,<ul>,<ol>,<small>,<h2>,<li>,<ol class="commentlist">,<table border="0">, <code>, <center>, </tr>, </tbody>, <tbody>, <script>, <strong>, <td>, <tr>, <em>, <table>, <embed>, <iframe>', 'content', TRUE, 'Continue Reading', FALSE, 2); ?>
                            <?php } ?>
    					</div>
  19. Aminiis
    Member
    Posted 8 months ago #

    what is your theme name?

  20. Thedishmaster
    Member
    Posted 8 months ago #

    Vesper

  21. mketch
    Member
    Posted 8 months ago #

    Hello
    Wondering if anyone can help me with customizing my wordpress site or if im in the wrong place where shld i post? The customization involves post/comment structure, comment boxes and ratings

  22. alchymyth
    The Sweeper
    Posted 8 months ago #

    @mketch
    please start your own topic -

    the 'How-To and Troubleshooting' forum is ok;

    however, interfering with existing topics is not welcome - http://codex.wordpress.org/Forum_Welcome

  23. mketch
    Member
    Posted 8 months ago #

    apologies and will do, thanks

  24. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    <?php the_excerpt_reloaded(1000, '<h3>,<h4>,<a>,<img>,<p>,<ul>,<ol>,<small>,<h2>,<li>,<ol class="commentlist">,<table border="0">, <code>, <center>, </tr>, </tbody>, <tbody>, <script>, <strong>, <td>, <tr>, <em>, <table>, <embed>, <iframe>', 'content', TRUE, 'Continue Reading', FALSE, 2); ?>

    That is the WEIRDEST code I've see in an excerpt in a long time. o.O

    the_excerpt_reloaded comes from a plugin, though.

  25. alchymyth
    The Sweeper
    Posted 8 months ago #

    for the last time: the 'wrong' comments link text does not come from the html code (i have posted that already, but you can check this yourself by looking into the html code of that area in the browser), but from javascript which is either from the disqus or any other plugin.

    deactivate javascript in your browser, and you will see 'Leave a Comment'.

  26. Thedishmaster
    Member
    Posted 8 months ago #

    Okay sorry. How do I deactivate the javascript?

  27. Thedishmaster
    Member
    Posted 8 months ago #

    If it's true that it's a plugin issue, then why does it appear when I click on the individual post?

    http://thedishmaster.com/2011/09/jon-stewarts-fuk-the-poor-best-bit-ever.html

    There you will see 'leave a comment' at the top, as desired. I've had issues where videos would appear in the individual post and not the home page b/c I did not tell the home page to show something with an <iframe> tag.

    Perhaps I'm wrong -- but I keep having this issue where I have to specify what appears on the home page. The code above are all of the tags I've specified (such as the center tag b/c videos that I centered would appear flush left on the home page and centered on the individual post)

  28. Thedishmaster
    Member
    Posted 8 months ago #

    Also -- thank you sooooo much for your help with this. I realize it's tedious and annoying -- it's just one of those things that is driving me nuts.

  29. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    Plugins do different things on different pages, and sometimes they don't ovverwrite/change things on ALL pages.

    You can test this yourself. Turn off Disqus (just for a minute) and look at your homepage. See if it goes away :) OR turn of JS

    http://mistered.us/tips/javascript/browsers.shtml

  30. Thedishmaster
    Member
    Posted 8 months ago #

    My major apologies. I deactivated the disqus plugin and you are correct!!!!! It now says "leave a comment!"

    Wow -- to think that I fought so hard and I was completely wrong.

    So now for my next question -- do you think that this needs to be changed in the plugin settings in disqus itself, or there's a way to change it in the code.

Reply »

You must log in to post.

About this Topic