• Resolved jason-hooper

    (@jason-hooper)


    I’m in the process of creating my theme and am working on the Comments. I’ve been tweaking forever, and for some reason the comments don’t seem to be accepting my CSS styling. I’ve gone to the point of copying a new comments.php file from a theme, and the accompanying CSS just to test, and still nothing. What in the world am I doing wrong???

    Here is a post from my site I’m using to help style with. Site is in development so please don’t make too much fun!

    Here is my comments.php:

    <?php // Do not delete these lines
    	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
            if (!empty($post->post_password)) { // if there's a password
                if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
    	?>
    
    		<p class="center"><?php _e("This post is password protected. Enter the password to view comments."); ?><p>
    
    <?php	return; } }
    	/* Function for seperating comments from track- and pingbacks. */
    	function k2_comment_type_detection($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') {
    		global $comment;
    		if (preg_match('|trackback|', $comment->comment_type))
    			return $trackbacktxt;
    		elseif (preg_match('|pingback|', $comment->comment_type))
    			return $pingbacktxt;
    		else
    			return $commenttxt;
    	}
    	$templatedir = get_bloginfo('template_directory');
    
    	$comment_number = 1;
    ?>
    <!-- You can start editing here. -->
    <?php if (($comments) or ('open' == $post-> comment_status)) { ?>
    <div id="comments">
    	<h3 class="comment_intro"><?php comments_number('0 comments', '1 comment so far', '% comments' );?> &darr;</h3>
    	<?php if ($comments) { ?>
    	<dl id="comment_list">
    	<?php $count_pings = 1; foreach ($comments as $comment) { ?>
    
    		<dt id="comment-<?php comment_ID() ?>"<?php if ($comment->comment_author_email == get_the_author_email()) { ?> class="author"<?php } ?>>
    			<span class="comment_num"><a href="#comment-<?php comment_ID() ?>" title="Permalink to this comment">#<?php echo($comment_number); ?></a></span>
    			<strong><?php comment_author_link() ?> </strong>on <?php comment_date('m.d.y') ?> at <?php comment_time() ?>
    		</dt>
    		<dd class="entry<?php if ($comment->comment_author_email == get_the_author_email()) { ?> author<?php } ?>">
    			<?php comment_text() ?>
    			<?php if ($comment->comment_approved == '0') : ?>
    			<p><strong>Your comment is awaiting moderation.</strong></p>
    			<?php endif; ?>
    		</dd>
    
    	<?php $comment_number++; } /* end for each comment */ ?>
    
    	</dl>
    
    	<?php } else { // this is displayed if there are no comments so far ?>
    		<?php if ('open' == $post-> comment_status) { ?>
    		<!-- If comments are open, but there are no comments. -->
    
    		<div class="entry">
    			<p>There are no comments yet...Kick things off by filling out the form below.</p>
    		</div>
    		<?php } else { // comments are closed ?>
    		<!-- If comments are closed. -->
    		<?php if (is_single) { // To hide comments entirely on Pages without comments ?>
    		<div class="entry">
    			<p>Like gas stations in rural Texas after 10 pm, comments are closed.</p>
    		</div>
    		<?php } ?>
    
    		<?php } ?>
    	<?php } ?>
    	<!-- Comment Form -->
    	<?php if ('open' == $post-> comment_status) : ?>
    
    		<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    
    			<p class="unstyled">You must <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">log in</a> to post a comment.</p>
    
    		<?php else : ?>
    			<h3 id="respond">Leave a Comment</h3>
    			<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comment_form">
    
    			<?php if ( $user_ID ) { ?>
    				<p class="unstyled">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
    			<?php } ?>
    			<?php if ( !$user_ID ) { ?>
    				<p><input class="text_input" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" tabindex="1" /><label for="author"><strong>Name</strong></label></p>
    				<p><input class="text_input" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" /><label for="email"><strong>Mail</strong></label></p>
    				<p><input class="text_input" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" tabindex="3" /><label for="url"><strong>Website</strong></label></p>
    			<?php } ?>
    				<!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
    
    				<p><textarea class="text_input text_area" name="comment" id="comment" rows="7" tabindex="4"></textarea></p>
    
    				<?php if (function_exists('show_subscription_checkbox')) { show_subscription_checkbox(); } ?>
    
    				<p>
    					<input name="submit" class="form_submit" type="submit" id="submit" tabindex="5" value="Submit" />
    					<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    				</p>
    
    				<?php do_action('comment_form', $post->ID); ?>
    
    			</form>
    		<?php endif; // If registration required and not logged in ?>
    <?php endif; // if you delete this the sky will fall on your head ?>
    </div> <!-- Close #comments container -->
    <?php } ?>

    and the CSS:

    /* COMMENT STYLES */
    #comments {
    width: 100%;
    }
    dl#comment_list {
    margin: 0 0 0 0;
    }
    
    dl#comment_list dt {
    padding: 0 0 33px 0;
    background: url('images/comment_top.gif') 0 100% no-repeat;
    font-size: 1.1em;
    line-height: 1.8182em;
    color: #999;
    }
    
    dl#comment_list dt.author {
    background: url('images/comment_author_top.gif') 0 100% no-repeat;
    }
    dl#comment_list dt .comment_num {
    padding: 0 0.3636em 0 0;
    }
    dl#comment_list dt .comment_num a, dl#comment_list dt .comment_num a:visited {
    color: #999;
    }
    dl#comment_list dt .comment_num a:hover {
    color: #a90000;
    }
    
    dl#comment_list dt strong {
    font-size: 1.4545em;
    color: #000;
    }
    
    dl#comment_list dt strong a, dl#comment_list dt strong a:visited {
    color: #000;
    border-bottom: 1px dotted #999;
    }
    
    dl#comment_list dt strong a:hover {
    color: #000;
    border-bottom: 1px solid #a90000;
    }
    
    dl#comment_list dd {
    padding: 20px;
    margin: 0 0 1.5385em;
    background: #dfdfdf;
    }
    
    dl#comment_list dd.author {
    background: #0099cc url('images/comment_author_bottom.gif') 0 100% no-repeat;
    }
    dl#comment_list dd.entry p, dl#comment_list dd.entry ul, dl#comment_list dd.entry ol, dl#comment_list dd.entry blockquote {
    margin-bottom: 1.1538em;
    }
    
    /* COMMENT FORM */
    #comment_form {
    width: 46.8em;
    margin: 0 0 4.0em 0;
    }
    
    #comment_form a:hover {
    text-decoration: underline;
    }
    #comment_form p {
    padding: 0.7692em 0;
    }
    
    #comment_form label {
    padding: 0 0 0 0.83333em;
    font-size: 1.2em;
    }
    
    #comment_form .text_input {
    width: 15.3846em;
    padding: 0.23077em;
    color: #a90000;
    font: bold 1.3em Verdana, sans-serif;
    border-top: 0.15385em solid #999;
    border-left: 0.15385em solid #999;
    border-right: 0.07692em solid #eee;
    border-bottom: 0.07692em solid #eee;
    }
    
    #comment_form .text_input:focus {
    border-top-color: #666;
    border-left-color: #666;
    border-right-color: #ddd;
    border-bottom-color: #ddd;
    }
    
    #comment_form .text_area {
    width: 32.9231em;
    }
    #comment_form p.subscribe-to-comments {
    font-size: 1.3em;
    }
    #comment_form p.subscribe-to-comments label {
    font-size: 1.0em;
    }
    
    #comment_form .form_submit {
    padding: 0.5em;
    background: url('images/submit_bg.gif') repeat-x;
    color: #000;
    border: 0.21429em double #999;
    border-top-color: #ccc;
    border-left-color: #ccc;
    font: bold 1.4em/1.0em "Helvetica Neue", Helvetica, Arial, sans-serif;
    cursor: pointer;
    }
    
    #comment_form .form_submit:hover {
    color: #0099cc;
    }
    
    .search_input {
    width: 210px;
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Comments not accepting styling’ is closed to new replies.