WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Disqus Comment System] How to remove View Comments? (10 posts)

  1. jerickko
    Member
    Posted 4 years ago #

    Is there a way to prevent Disqus from changing the wordings of the comments link on index and single post?

    Before I installed the latest version of Disqus, the comments link in each post of my blog used to say "Comments" and "#" (where # is the number of comments).
    But now it says "View Comments" for both, which makes my blog look very unaesthetic. For some posts, it changes to "View Comments" and "# Comments and # Reactions".

    Any help would be very appreciated.

  2. jerickko
    Member
    Posted 4 years ago #

    Anyone?

  3. jerickko
    Member
    Posted 4 years ago #

    Please?

  4. seferov
    Member
    Posted 4 years ago #

    Hi,

    From Plugin Editor select Disqus Comment System. In disqus.php file find
    ‘<span class="dsq-postid-’.$post->ID.‘">View Comments</span>’;
    and replace with
    ‘<span class="dsq-postid-’.$post->ID.‘">’.$comment_text.‘</span>’;

  5. cyberquill
    Member
    Posted 3 years ago #

    Doesn't work. Now it just says ’.$comment_text.‘ on the page.

    Plus when I click on "View Comments" (or whatever I may replace it with) it doesn't take me anywhere.

  6. Ma3xl3
    Member
    Posted 3 years ago #

    @cyberquil
    since 2.60 it doesn't work.

    try the following line:
    return '<span class="dsq-postid">' . $post->comment_count . '</span>';

  7. cyberquill
    Member
    Posted 3 years ago #

    if ( dsq_can_replace() ) {
    		return '<span class="dsq-postid" rel="'.htmlspecialchars(dsq_identifier_for_post($post)).'">View Comments</span>';
    	} else {
    		return $comment_text;
    	}
    }

    If I leave the above version as is, then below all the headlines on my index page I get the correct comment count as specified in index.php:

    '<?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>'

    Clicking on it produces a URL ending in .../#disqus_thread and it leads to the Disqus comment section. So the index page works fine.

    On my single post page, however, all I get is "View Comments" and clicking on it gives a URL that ends in .../#respond that leads nowhere UNLESS I put an '< a name="respond">' anchor tag in the Disqus comments.php file.

    If I apply your suggestion and modify the code to this:

    'if ( dsq_can_replace() ) {
    return '<span class="dsq-postid">' . $post->comment_count . '</span>';
    } else {
    return $comment_text;
    }
    }'

    I get "View Comments" under the headlines on my index page (= NO comment count), although clicking on it still leads to the comment section, and under the headline on my single post page I get a plain number, such as "2" without the word "comments". Clicking on it still leads nowhere without the additional respond anchor tag.

  8. merkonomics
    Member
    Posted 3 years ago #

    experiencing the same problem here -

    lets make some magic happen with this -

  9. cyberquill
    Member
    Posted 3 years ago #

    The magic that ultimately worked for me was to put a check mark next to “Output JavaScript in footer” under Advanced Options in the Disqus Dashboard.

  10. Janu Studio
    Member
    Posted 3 years ago #

    @seferov man you are king... it just took 1 second for me to solve the error... God bless u....

Topic Closed

This topic has been closed to new replies.

About this Topic