Tuesday, 21 May 2013

Fatal error: Cannot redeclare comment_theme()

Fatal error: Cannot redeclare comment_theme()

I have this wordpress site build up. In the blog section my post is getting repeated which I do not want how can I get rid of this situation
Use this link: http://rymahrice.com/some-energy-drinks-contain-too-much-caffeine-for-kids/
scroll down and you will notice the error and the whole post being repeated.
Below is the code:
<?php
/*
    The template for displaying Comments.
*/
?>
<?php
function comment_theme($comment, $args, $depth) {
    $GLOBALS['comment'] = $comment; ?>
    <li <?php comment_class("clearfix"); ?> id="li-comment-<?php comment_ID() ?>">
        <div id="comment-<?php comment_ID(); ?>" class="comment_wrap">
            <div class="gravatar">
                <?php echo get_avatar($comment,$size='60',$default=''); ?>
                <time class="comment_time"><?php echo get_comment_date(); ?></time>
            </div>
            <div class='comment_content'>
                <div class="comment_meta">
                    <h4><?php printf( '<cite class="comment_author">%s</cite>', get_comment_author_link()) ?></h4>

                </div>
                <div class='comment_text'>
                    <?php comment_text() ?>
                    <?php if ($comment->comment_approved == '0') : ?>
                    <span class="unapproved"><?php _e('Your comment is awaiting moderation.', 'fringe_tech') ?></span>
                    <?php endif; ?>
                    <?php edit_comment_link(__('(Edit)', 'fringe_tech' ),'  ','') ?>
                </div>
                <div class="reply">
                    <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
                </div>
            </div>
        </div>
<?php
}
?>

<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.', 'fringe_tech' ); ?></p>
</div>
<?php   return;
    endif;
?>

<?php if ( have_comments() ) : ?>
    <h3 id="comments-title"><?php
    printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'fringe_tech' ),
    number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
    ?></h3>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    <div class="navigation">
        <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'fringe_tech' ) ); ?></div>
        <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'fringe_tech' ) ); ?></div>
    </div>
<?php endif; ?>
<div id="contents">
    <ol class="commentlist">
        <?php wp_list_comments( array( 'callback' => 'comment_theme' ) ); ?>
    </ol>
</div>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
            <div class="navigation">
                <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'fringe_tech' ) ); ?></div>
                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <

No comments:

Post a Comment