Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Sandbox Comment Template Error WordPress

  • SOLVED

I am using the Sandbox WordPress theme, and I have altered the comments area slightly - I have run into an error that I can not resolve.

Right after posting a comment, my comment area seems to break, my comments disappear and my sidebar overlaps the comment area.

Here is my working area......
http://lab.inspiredology.com/holly-web-header-hell/#comments

Once this error is resolved I would also like to enable Threaded Comments, whoever can fix the error, I am open for solutions on enabling threaded comments as well. There will be compensation for this as well. I can either open a new question or send a payment directly to you.



<div class="mainSplitter">
&nbsp;
</div>
<div class="commentBox">
<?$i;?>
<?php
if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
die ( 'Please do not load this page directly. Thanks.' );
?>
<div id="comments">
<?php
if ( !empty($post->post_password) ) :
if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) :
?>
<div class="nopassword"><?php _e( 'This post is protected. Enter the password to view any comments.', 'sandbox' ) ?></div>
</div><!-- .comments -->
<?php
return;
endif;
endif;
?>
<?php if ( $comments ) : ?>
<?php global $sandbox_comment_alt ?>

<?php // Number of pings and comments
$ping_count = $comment_count = 0;
foreach ( $comments as $comment )
get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;
?>
<?php if ( $comment_count ) : ?>
<?php $sandbox_comment_alt = 0 ?>

<div id="comments-list" class="comments">
<h2>Join the discussion</h2>

<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
<?php $i++ ; ?>
<li id="comment-<?php comment_ID() ?>" class="<?php alternate_rows_author_comment($i, $comment, $post); ?>">

<div class="comment-author vcard"><?php echo get_avatar( $comment, 60 ); ?></div>
<div class="comment-name"><?php comment_author() ?></div>
<div class="comment-meta"><?php printf(__('%1$s at %2$s', 'sandbox'),
get_comment_date(),
get_comment_time(),
'#comment-' . get_comment_ID() );
edit_comment_link(__('', 'sandbox'), '', ''); ?></div>
<?php if ($comment->comment_approved == '0') _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'sandbox') ?>
<?php comment_text() ?>
</li>
<?php } else { $trackback = true; } /* End of is_comment statement */ ?>
<?php endforeach; ?>

</div><!-- #comments-list .comments -->

<?php endif; // REFERENCE: if ( $comment_count ) ?>
<?php if ( $ping_count ) : ?>
<?php $sandbox_comment_alt = 0 ?>

<div id="trackbacks-list" class="trackbacks">
<h2 class="trigger">
<a href="#">
<?php printf($ping_count > 1 ? __('<span>%d</span> Trackbacks', 'sandbox') : __('<span>One</span> Trackback', 'sandbox'), $ping_count) ?>
</a></h2>
<div class="toggle_container">
<div class="block">
<?php foreach ( $comments as $comment ) : ?>
<?php if ( get_comment_type() != "comment" ) : ?>

<!--POSSIBLE AUTHOR COMMENT STYLES-->
<li class="<?php if ($comment->user_id == 1) $oddcomment = "authorstyle"; echo $oddcomment; ?>"
<!--END POSSIBLE AUTHOR STYLES-->
<div class="comment-name"><?php printf(get_comment_author_link()) ; ?></div>
<div class="comment-meta"><?php printf(__('%1$s on %2$s', 'sandbox'),
get_comment_date(),
get_comment_time() );
edit_comment_link(__('', 'sandbox'), '', '</span>'); ?></div>
<?php if ($comment->comment_approved == '0') _e('\t\t\t\t\t<span class="unapproved">Your trackback is awaiting moderation.</span>\n', 'sandbox') ?>
</li>
<?php endif // REFERENCE: if ( get_comment_type() != "comment" ) ?>
<?php endforeach; ?>

</div><!--TOGGLE BLOCK-->
</div><!--TOGGLE CONTAINER-->
</div><!-- #trackbacks-list .comments -->
<div class="clear"></div>


<?php endif // REFERENCE: if ( $ping_count ) ?>
<?php endif // REFERENCE: if ( $comments ) ?>
<?php if ( 'open' == $post->comment_status ) : ?>
<?php $req = get_option('require_name_email'); // Checks if fields are required. Thanks, Adam. ;-) ?>

<div id="respond">
<h2><?php _e( 'Post a Comment', 'sandbox' ) ?></h2>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p id="login-req"><?php printf(__('You must be <a href="%s" title="Log in">logged in</a> to post a comment.', 'sandbox'),
get_bloginfo('wpurl') . '/wp-login.php?redirect_to=' . get_permalink() ) ?></p>

<?php else : ?>
<div class="formcontainer">
<form id="commentform" action="<?php bloginfo('wpurl') ?>/wp-comments-post.php" method="post">

<?php if ( $user_ID ) : ?>
<p id="login"><?php printf( __( '<span class="loggedin">Logged in as <a href="%1$s" title="Logged in as %2$s">%2$s</a>.</span> <span class="logout"><a href="%3$s" title="Log out of this account">Log out?</a></span>', 'sandbox' ),
get_bloginfo('wpurl') . '/wp-admin/profile.php',
wp_specialchars( $user_identity, 1 ),
get_bloginfo('wpurl') . '/wp-login.php?action=logout&amp;redirect_to=' . get_permalink() ) ?></p>

<?php else : ?>

<p id="comment-notes"><?php _e( 'Your email is <em>never</em> shared.', 'sandbox' ) ?> <?php if ($req) _e( 'Required fields are marked <span class="required">*</span>', 'sandbox' ) ?></p>

<div class="form-label"><label for="author"><?php _e( 'Name', 'sandbox' ) ?></label> <?php if ($req) _e( '<span class="required">*</span>', 'sandbox' ) ?></div>
<div class="form-input"><input id="author" name="author" class="text<?php if ($req) echo ' required'; ?>" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="50" tabindex="3" /></div>

<div class="form-label"><label for="email"><?php _e( 'Email', 'sandbox' ) ?></label> <?php if ($req) _e( '<span class="required">*</span>', 'sandbox' ) ?></div>
<div class="form-input"><input id="email" name="email" class="text<?php if ($req) echo ' required'; ?>" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /></div>

<div class="form-label"><label for="url"><?php _e( 'Website', 'sandbox' ) ?></label></div>
<div class="form-input"><input id="url" name="url" class="text" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div>


<?php endif // REFERENCE: * if ( $user_ID ) ?>

<div class="form-label"><label for="comment"><?php _e( 'Comment', 'sandbox' ) ?></label></div>
<div class="form-textarea"><textarea id="comment" name="comment" class="text required" cols="45" rows="8" tabindex="6"></textarea></div>

<div class="form-submit"><input id="submit" name="submit" class="button" type="submit" value="<?php _e( '', 'sandbox' ) ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id ?>" /></div>


<div class="form-option"><?php do_action( 'comment_form', $post->ID ) ?></div>

</form><!-- #commentform -->
</div><!-- .formcontainer -->
<?php endif // REFERENCE: if ( get_option('comment_registration') && !$user_ID ) ?>

</div><!-- #respond -->
<?php endif // REFERENCE: if ( 'open' == $post->comment_status ) ?>

</div><!-- #comments -->
</div><!--.commentBox-->
<?php include ('sidebar-comment.php'); ?>

Answers (4)

2010-06-10

Oleg Butuzov answers:

wrong
edit_comment_link(__('', 'sandbox'), '', '</span>'); ?>
right
edit_comment_link(__('<span>', 'sandbox'), '', '</span>'); ?>

-----------------------

li (comments ) actualy should be list items, but the no ul or ol tags so ----

<div class="block"> <ul>

and close it

</ul></div><!--TOGGLE BLOCK-->


----

actualy will be better to make step by step code replace. i mean line - by line. code isn't prety formated and hard reading.


Chad Mueller comments:

doesn't change anything...


Oleg Butuzov comments:

Chad if you can provide a access for editionf your comments.php problem can be resolved in a faster way. my mail info in my profile.

2010-06-10

Utkarsh Kukreti answers:

Try removing the 16th line

</div><!-- .comments -->


Chad Mueller comments:

Didn't change anything....

2010-06-10

Colin Pool answers:

The sidebar isnt' that hard. I tried something with Firebug. You only have to change some of the widths of the sidebar in your css. The other problems are harder to fix. The splitter line (.mainSplitter) makes a problem on the right top of the comments box and the problem in the comments I couldn't find in the time I spend on it.


div#secondary {
background:url("../images/commentSidebarBackground.jpg") repeat-y scroll left top transparent;
height:100%;
margin-right:12px;
margin-top:-12px;
padding:0;
width:324px;
}
2c-r.css (line 41)

div.sidebar {
float:right;
width:324px;
}

.widgetSocial {
background:url("images/widget_background.jpg") repeat-x scroll left top #222C3C;
float:right;
height:100%;
margin:0;
padding:0;
width:324px;
}
style.css (line 438)


Chad Mueller comments:

I think once the comment error is resolved the sidebar will sit in the proper place - I believe it is moving to the left because the comments aren't there anymore....

2010-06-11

Rashad Aliyev answers:

Hello try to remove this one at the bottom and test again: </div><!-- #comments -->


P.S: not, </div><!-- .comments -->!!!!!! Remove only from bottom and test it.


</div><!-- #comments -->


Rashad Aliyev comments:

If doesn't change then restore back </div><!-- #comments --> and try to remove from the top this code:


Mistake:

<div class="mainSplitter">

&nbsp;

</div>


RIGHT:

</div><div class="mainSplitter">



Rashad Aliyev comments:

OPPPSSSS.. soryy: right version is like that: RIGHT:

<div class="mainSplitter">RIGHT:

<div class="mainSplitter">


without
&nbsp;
</div>

best regards,

If still doesn't solve then contact with me.