[resolved] Want to replace text " Comment" to button (5 posts)

  1. prasun1519
    Posted 2 years ago #

    Hi All,

    I want to replace the text "Comment" with "Reply" button at the bottom of the post page. Please let me know how could I do that.

    Here is the link of the post page:

    Here you can see there is 0 Comment at the bottom of the post. I want to replace it something like "0 reply_button".

    Please can anyone help?


  2. manavkumar
    Posted 2 years ago #

    step 1: create new file called your-script.js in js folder under your custom theme directory and put this code in this file

    $("div.btn a").text("Reply");

    step 2: now open function.php file in your custom theme folder and write this code:

    function add_my_script() {
    wp_enqueue_script( 'change_anchor_text', get_template_directory_uri() . '/js/your-script.js');

    add_action( 'wp_enqueue_scripts', 'add_my_script' );

  3. prasun1519
    Posted 2 years ago #


    Thanks a lot for your help. Actually my requirement is something different. I need to replace the "Comment" text with custom image which uploaded to the server. Is there anyway to use that image?

    Thanks & regards

  4. Michael
    Forum Moderator
    Posted 2 years ago #

    look for comments_popup_link() in the tempalte for the posts page, possibly index.php (details will depend on your used theme which seems to be a custom designed one).

    you might be able to make the changes there;

    if not, please post the code of index.php or of the corresponding templates which are used to show the posts ...

  5. prasun1519
    Posted 2 years ago #

    Hi All,

    Got the solution. Alchymyth, you are right. The option is located within comments_popup_link() funtion in comment-template file under wp-include. You need to change text with the image code.

    Thanks for your kind attention and suggestion to this issue.


Topic Closed

This topic has been closed to new replies.

About this Topic