ThemeShaper Forums » Thematic


Put Comment in DIV

(2 posts)
  • Started 11 years ago by bogh
  • Latest reply from bogh
  • This topic is resolved


  1. bogh

    I am trying to put each comment into a DIV

    The only way I've found is that:

    // Custom callback to list comments in the Thematic style
    function mytheme_comments($comment, $args, $depth) {
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    <li id="comment-<?php comment_ID() ?>" class="<?php thematic_comment_class() ?>">
    //START Opening DIV
    //END Opening DIV
    <div class="comment-author vcard"><?php thematic_commenter_link() ?></div>
    <div class="comment-meta"><?php printf(__('%1$s', 'thematic'),
    get_comment_date() ); ?></div>
    <?php if ($comment->comment_approved == '0') _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'thematic') ?>
    <div class="comment-content">
    <?php comment_text() ?>
    if($args['type'] == 'all' || get_comment_type() == 'comment') :
    comment_reply_link(array_merge($args, array(
    'reply_text' => __('Reply','thematic'),
    'login_text' => __('Log in to reply.','thematic'),
    'depth' => $depth,
    'before' => '<div class="comment-reply-link">',
    'after' => '</div>'
    //START Closing DIV
    //END Closing DIV
    <?php }
    function my_callback() {
    $content = 'type=comment&callback=mytheme_comments';
    return $content;
    add_filter('list_comments_arg', 'my_callback');

    I just want to add the Opening DIV and the Closing Div, to the post's content, just like above, but without rewriting the post's content.
    Please tell me that is possible :)

    Maybe something like below:

    // Add Header DIVs
    function open_header() { ?><div><?php }
    function close_header() { ?></div><?php }
    Posted 11 years ago #
  2. bogh

    I found my answer in library/extensions/discussion.php

    And I have made it like that:

    function open_com() { ?><div class="blablabla"><?php }
    function close_com() { ?></div><?php }

    Thank you.

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.