ThemeShaper Forums » Thematic

[closed]

Put Comment in DIV

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

Tags:

  1. bogh
    Member

    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
    <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() ?>
    </div>
    <?php
    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>'
    
    )));
    endif;
    ?>
    
    //START Closing DIV
    <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 }
    add_action('thematic_header','open_header',0);
    
    function close_header() { ?></div><?php }
    add_action('thematic_header','close_header',11);
    Posted 11 years ago #
  2. bogh
    Member

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

    And I have made it like that:

    function open_com() { ?><div class="blablabla"><?php }
    add_action('thematic_abovecomment','open_com',0);
    
    function close_com() { ?></div><?php }
    add_action('thematic_belowcomment','close_com',0);

    Thank you.

    Posted 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.