I have been trying to figuire this out all evening and can’t make sense and am not really sure what to search for on search engines. I am pretty much a noob at wordpress. I know HTML, CSS and I can customise a basic WP template, it’s just this last bit on the comments area that I need to customise which I am having trouble with.
This is what I have in my comments.php in my theme
[INDENT]<?php
/**
- The template for displaying Comments.
- The area of the page that contains both current comments
- and the comment form. The actual display of comments is
- handled by a callback to twentyten_comment which is
- located in the functions.php file.
- @package WordPress
- @subpackage Twenty_Ten
- @since Twenty Ten 1.0
*/
?>
<div id=“comments”>
<?php if ( post_password_required() ) : ?>
<p class=“nopassword”><?php _e( ‘This post is password protected. Enter the password to view any comments.’, ‘twentyten’ ); ?></p>
</div><!-- #comments –>
<?php
/* Stop the rest of comments.php from being processed,
- but don’t kill the script entirely – we still have
- to fully load the template.
*/
return;
endif;
?>
<?php
// You can start editing here – including this comment!
?>
<?php if ( have_comments() ) : ?>
<tr><td class=“comment-responses”><?php
printf( _n( ‘One Response to %2$s’, ‘%1$s Responses to %2$s’, get_comments_number(), ‘twentyten’ ),
number_format_i18n( get_comments_number() ), ‘<em>’ . get_the_title() . ‘</em>’ );
?></td></tr>
<!–comments–><tr><td class=“maincontent_postcomments”>
<div>
<?php wp_list_comments(‘callback=mytheme_comment’); ?>
</div>
</td></tr> <!--endcomments-->
<?php if ( get_comment_pages_count() > 1 && get_option( ‘page_comments’ ) ) : // Are there comments to navigate through? ?>
<!--pagination--><tr><td class="comments-pagination-td"><div class="comments-pagination"><?php previous_comments_link( __( '<' ) ); ?></div><div class="comments-pagination"><?php next_comments_link( __( '>' ) ); ?></div></td></tr>
<?php endif; // check for comment navigation ?>
<?php else : // or, if we don’t have comments:
if ( ! comments_open() ) :
?>
<p class=“nocomments”><?php _e( ‘Comments are closed.’ ); ?></p>
<?php endif; // end ! comments_open() ?>
<?php endif; // end have_comments() ?>
<!--commentform--><tr><td class="comment-form">
<?php comment_form_title( ‘Leave a Reply’ ); ?>
<?php comment_form( $args, $post_id ); ?>
<div></div>[/INDENT]
This is how it looks on my wordpress blog: The site is up… | Lucinda
I have managged to customise the comments_list with a callback that I customised in the functions.php file which is in the themes folder.
I have been trying to do something similar with the comment_form because you can see how it looks at the moment - the default look.
So, my question is do you also use a ‘function thing’ for this, like you do with the comments_list ? because the way I managed to code that to how I like is because I used the default function for the comments_list and took the tags(I don’t know if that’s what theyre called, but anyway - the codes like ‘<?php comment_text(); ?>’
This is how the area of my functions.php for the comments_list looks
[INDENT]function mytheme_comment( $comment, $args, $depth ) {
$GLOBALS[‘comment’] = $comment;
switch ( $comment->comment_type ) :
case ‘’ :
?>
<!–comments–> <tr><td class=“maincontent_postcomments”><div>
<div class=“comments_datenameedit”><?php
/* translators: 1: date, 2: time */
printf( __( ‘%1$s’, ‘twentyten’ ), get_comment_date(), get_comment_time() ); ?></div>
<div class=“comments_datenameedit”><?php printf( __( ‘Comment by %s’ ), sprintf( ‘%s’, get_comment_author_link() ) ); ?></a></div>
<div class=“comments_datenameedit”><a href=“http://”><?php edit_comment_link( __( ‘(Edit)’, ‘twentyten’ ), ’ ’ );
?></a></div>
<div class=“comments_comment”><?php comment_text(); ?></div>
<div class=“comments_datenameedit”><a href=“http://”><?php comment_reply_link( array_merge( $args, array( ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’] ) ) ); ?></a></div>
</div>
</td></tr> <!-- #comment-## -->[/INDENT]
I get confused because in the codex files it says that the source is in wp-includes but I need to have the customisation of it in the theme folder obviously - I just don’t know how to do it.
Because I have customised the rest of the template, I’m sure I could learn how to do it.
Thanks for any help