Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Flag Comments Plugin

    to get this plugin working with the latest version of wordpress u need to do a custom comments loop like it mentions here:
    http://codex.wordpress.org/Template_Tags/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display

    this is what i did in mine

    in comments.php replace:
    <?php wp_list_comments(); ?>

    with :

    <?php wp_list_comments(‘type=comment&callback=mytheme_comment’); ?>

    then, in your functions.php file, add the following function:

    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-author vcard”>
    <?php echo get_avatar($comment,$size=’48’,$default='<path_to_url>’ ); ?>

    <?php printf(__(‘<cite class=”fn”>%s</cite> <span class=”says”>says:</span>’), get_comment_author_link()) ?>
    </div>
    <?php if ($comment->comment_approved == ‘0’) : ?>
    <?php _e(‘Your comment is awaiting moderation.’) ?>

    <?php endif; ?>

    <div class=”comment-meta commentmetadata”>comment_ID ) ) ?>”><?php printf(__(‘%1$s at %2$s’), get_comment_date(), get_comment_time()) ?><?php edit_comment_link(__(‘(Edit)’),’ ‘,”) ?><?php do_action(“flag_comment_link”); ?></div>

    <?php comment_text() ?>

    <div class=”reply”>
    <?php comment_reply_link(array_merge( $args, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>
    </div>
    </div>
    <?php
    }

    you need to reset the query before the conditional statement
    <?php wp_reset_query(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)