Controlling children comments wordpress
-
Hi guys,
I’m building a theme from scratch using starkers and up to the point of styling the comments section which i have made some good progress with.
I’m up to the point where if the user was to reply to the comment obviously the child will go underneath inside but i’m having problems controlling the styling as its seems that the styling of the parent comment is used for the child. At the moment with my code ive only got as far as the children going underneath like this
https://img46.imageshack.us/img46/7945/screenshot20100326at112d.png
but i wont to be able to do it like this https://img46.imageshack.us/img46/8954/commentexample.jpgI’m not a great coder in php its new to me so at the moment i have the styling and control through the functions.php but if you look at my example i would like to have the child gravatar smaller and and the styling a little different from the parent as its inside the parent comment.
Would anyone be helpful enough to shed some light on how i would be able to achieve such a style?
Heres my function.php code for the comments, but i can not identify where and how to insert the child structure where obviously i would be able to easily style the children through divs.
function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>" <div class="comment_structure"> <div class="left"><div class="gravatar"><?php echo get_avatar($comment,$size='70',$default='<path_to_url>' ); ?></div></div> <div class="arrow_comments"></div> <div class="right"> <div class="comment"> <cite class="name"><?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?></cite> <div class="commentdate"><?php printf(__('%1$s'), get_comment_date()) ?><?php edit_comment_link(__('(Edit)'),' ','') ?></div> <div class="reply"><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div> <div class="clear"></div> <div class="hr"></div> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.') ?></em> <br /> <?php endif; ?> <?php comment_text() ?></div></div> <div class="clear"></div> <?php } ?> </div><!-- end comment_structure -->
- The topic ‘Controlling children comments wordpress’ is closed to new replies.