• Hey there!

    I am creating a new word press theme, and have gone to add a comments form. However, when I add a comment I get the following error:

    Warning: call_user_func() expects parameter 1 to be a valid callback, function ‘tranquil_comment’ not found or invalid function name in /home/tranquil/public_html/john/wp-includes/comment-template.php on line 1334

    Does anyone know that this means? If you can help I will be most helpful.

    Kind Regards,
    Jonathan knight.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Pretty much what it says on the tin. You have referenced a function called tranquil_comment() that you have not actually defined in your theme’s functions.php file.

    Thread Starter knight1120764

    (@knight1120764)

    o.O Ohh God. What a nooby mistake -.-‘ Haha awks.

    It’s Friday. It’s allowed. ??

    Thread Starter knight1120764

    (@knight1120764)

    This is going to sound really nooby.. but how would I add that to my functions.php file? I’ve completely lost my mind… I keep getting errors xD

    You would just create it like any other function. Right now, we don’t really have any idea what the function is for.

    Thread Starter knight1120764

    (@knight1120764)

    Basically, I have a comment form. The form works perfectly.. it adds comments to be approved by an admin etc. The only issue is when it comes to viewing comments on the single posts page, you just get a warning come up.

    “Warning: call_user_func() expects parameter 1 to be a valid callback, function ‘tranquil_comment’ not found or invalid function name in /home/tranquil/public_html/john/wp-includes/comment-template.php on line 1334”.

    We know that bit. But we have no idea why you are using this function, where in the code this function is being called or what the function is supposed to do.

    Thread Starter knight1120764

    (@knight1120764)

    <div class="countcomments"><?php comments_number( '', ''. __( '1 Comment', 'tranquil' ) .'', '% '. __( 'Comments', 'tranquil' ) .'' ); ?></div>
    
    				<strong><?php wp_list_comments( array( 'callback' => 'tranquil_comment' ) ); ?></strong>
    
    <?php paginate_comments_links(); ?>
    <div class="commentform"><?php
    
    $comments_args = array (
    
    'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __( 'Comment', 'tranquil' ) . '</label></br>
            <textarea id="comment" rows="8" name="comment" aria-required="true"></textarea></p>',
    
    );
    
    $comments_args['fields'] = array(
    
          'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'tranquil' ) . '</label> <span class="required">*</span></br>  <input id="author" name="author" type="text" value="" size="30" /></p>',
    
    'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email', 'tranquil' ) . '</label>
     <span class="required">*</span></br> <input id="email" name="email" type="text" value="" size="30" /></p>',
    
    'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website', 'tranquil' ) . '</label></br> <input id="url" name="url" type="text" value="" size="30" /></p>',
    
    );
    
    comment_form($comments_args);
    
     ?><div style="clear:both;"></div></div></div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Commenting Error’ is closed to new replies.