Results 1 to 5 of 5

Thread: comment_form php is missing

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    2

    comment_form php is missing

    I would like to change the text in the are where readers can type their comments.
    For example: "Leave a reply" and "Your message".
    As you can see here: http://kittyarends.nl/yoga/kitty/

    In the html code there is a reference to the comment_form, but I can't find a corresponding php fle, of or any other option in the admin to edit that particular part of the template.

    I hope someone can help me out with this issue.
    Thanks!

    Katja

  2. #2
    Hello Katja.

    Comment form is generated by WordPress native comment_form() function that you can find in comments.php.
    There are two ways to change Leave a replay text.

    First: copy comments.php into your child theme, now comment form function accepts two parameters and looks like this:
    PHP Code:
    comment_form(array('comment_notes_after' => '''comment_notes_before' => '')); 
    replace it with this:
    PHP Code:
    comment_form( array(
            
    'comment_notes_after' => '',
            
    'comment_notes_before' => '',
            
    'title_reply' => __'My Title' ),
            
    'title_reply_to' => __'My Title to %s' )
            ) ); 
    Second: or you can use comment_form_defaults filter, place this code somewhere in your functions.php:
    PHP Code:
    /**
     * Change comment form reply titles.
     */
    function mamaduka_title_reply$args ) {
        
    $args['title_reply'] = __'My Title' );
        
    $args['title_reply_to'] = __'My Title to %s' );
        
        return 
    $args;
    }
    add_filter'comment_form_defaults''mamaduka_title_reply' ); 

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Posts
    2
    Hi Mamaduk, thanks!
    I managed to change the 'leave a reply' with the code you provided.
    I also want to change the default text in the text area of the comment box, which says 'your message'.
    I found a page that lists all the comment form commands, but I'm not sure which one I could use:
    http://codex.wordpress.org/Function_...e/comment_form

    thanks again!

  4. #4
    Sorry forgot about "Your Message" text, this text is added via JavaScript, you can find it in header.php.

  5. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    1
    That was really helpful Mamaduka, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •