WordPress.org

Forums

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

  1. prasun1519
    Member
    Posted 1 year 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:
    link

    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?

    Thanks
    Prasun

  2. manavkumar
    Member
    Posted 1 year 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

    $(document).ready(function(){
    $("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
    Member
    Posted 1 year ago #

    Hi,

    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
    Prasun

  4. alchymyth
    Forum Moderator
    Posted 1 year 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;
    http://codex.wordpress.org/Function_Reference/comments_popup_link

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

  5. prasun1519
    Member
    Posted 1 year 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.

    Regards
    Prasun

Topic Closed

This topic has been closed to new replies.

About this Topic