Support » Fixing WordPress » Want to replace text " Comment" to button

  • Resolved prasun1519

    (@prasun1519)


    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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’ );

    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

    Michael

    (@alchymyth)

    Forum Moderator

    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 …

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Want to replace text " Comment" to button’ is closed to new replies.