windhamdavid 11 years ago
parent
commit
657a263080
6 changed files with 241 additions and 39 deletions
  1. 28 9
      comments.php
  2. 0 2
      footer.php
  3. 7 25
      functions.php
  4. 4 3
      inc/template.php
  5. 14 0
      js/script.js
  6. 188 0
      style.css

+ 28 - 9
comments.php

@@ -1,19 +1,38 @@
+<?php if ( comments_open() ): ?>
+<div class="commentbubble"><a href="#" class="toggle-comments"><?php comments_number('0', '1', '%'); ?> Comments</a></div>
+<?php endif;?>
 <div id="comments" class="comments-area">
 	<?php if ( have_comments() ) : ?>
-		<ol class="commentlist">
-			<?php wp_list_comments( array( 'callback' => 'dw_comment', 'style' => 'ol' ) ); ?>
-		</ol>
-		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
+		<ul class="commentlist">
+			<?php wp_list_comments( array( 
+				'callback' => 'dw_comment',
+				'style' => 'ul', 
+				'avatar_size' => 16,
+				'short_ping' => true
+				) ); 
+			?>
+		</ul>
+		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
 		<nav id="comment-nav-below" class="navigation" role="navigation">
-			<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
-			<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentytwelve' ) ); ?></div>
-			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentytwelve' ) ); ?></div>
+			<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'dw' ); ?></h1>
+			<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'dw' ) ); ?></div>
+			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'dw' ) ); ?></div>
 		</nav>
 		<?php endif;?>
 		<?php
 		if ( ! comments_open() && get_comments_number() ) : ?>
-		<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
+		<p class="nocomments"><?php _e( 'Comments are closed.' , 'dw' ); ?></p>
 		<?php endif; ?>
 	<?php endif;?>
-	<?php comment_form(); ?>
+	<?php comment_form(
+		array(
+			'comment_notes_after' => '',
+			'comment_notes_before' => '',
+			'title_reply' => __( '' ),
+			'title_reply_to' => __( 'Leave a Reply to %s' ),
+			'cancel_reply_link' => __( 'Cancel' ),
+			'label_submit' => __( 'Comment' ),
+			'url' => __( 'URL' ),
+		)
+	); ?>
 </div>

+ 0 - 2
footer.php

@@ -10,10 +10,8 @@
   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
   })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
   ga('create', 'UA-1906067-6', 'davidawindham.com');
   ga('send', 'pageview');
-
 </script>
 </body>
 </html>

+ 7 - 25
functions.php

@@ -8,21 +8,24 @@ function dw_setup() {
 endif; 
 add_action( 'after_setup_theme', 'dw_setup' );
 
+add_theme_support( 'automatic-feed-links' );
+add_theme_support( 'menus' );
 add_theme_support( 'post-thumbnails' );
 set_post_thumbnail_size( 150, 150, true );
 add_image_size( 'post-large', 770, 577, true );
-add_theme_support( 'automatic-feed-links' );
-add_theme_support( 'menus' );
+
 
 function dw_scripts() {
 	global $post;
 	wp_deregister_script('jquery');
 	wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), false, true);
-	wp_enqueue_script( 'jquery', '', '', '', true );
 	wp_enqueue_style( 'style', get_stylesheet_uri() );
+	wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', 'jquery', '', true );
+	wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', 'jquery', '', true );
 	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
-		wp_enqueue_script( 'comment-reply' );
+		wp_enqueue_script( 'comment-reply', '', '', '', true );
 	}
+
 }
 add_action( 'wp_enqueue_scripts', 'dw_scripts' );
 
@@ -31,25 +34,4 @@ function dw_editor() {
 }
 add_action( 'init', 'dw_editor' );
 
-$comments_args = array(
-	        'comment_notes_after' => '',
-			'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
-			'comment_field'        => '<p class="comment-form-comment">...',
-			'must_log_in'          => '<p class="must-log-in">...',
-			'logged_in_as'         => '<p class="logged-in-as">...',
-			'comment_notes_before' => '<p class="comment-notes">...',
-			//'comment_notes_after'  => '<dl class="form-allowed-tags">...',
-			'id_form'              => 'commentform',
-			'id_submit'            => 'submit',
-			'title_reply'          => __( 'Leave a Reply' ),
-			'title_reply_to'       => __( 'Leave a Reply to %s' ),
-			'cancel_reply_link'    => __( 'Cancel reply' ),
-			'label_submit'         => __( 'Post Comment' ),
-	);
-comment_form($comments_args);
-
-function dw_ping($comment, $args, $depth) {
-	
-}
-
 ?>

+ 4 - 3
inc/template.php

@@ -198,20 +198,21 @@ function dw_comment( $comment, $args, $depth ) {
 	<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, 40 ); ?>
-			<?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>', 'daw' ), get_comment_author_link() ); ?>
+			<?php echo get_avatar( $comment, 16 ); ?>
+			<?php printf( __( '<cite class="fn">%s</cite><span class="says">:</span>', 'daw' ), get_comment_author_link() ); ?>
 		</div>
 		<?php if ( $comment->comment_approved == '0' ) : ?>
 			<em><?php _e( 'Your comment is awaiting moderation.', 'daw' ); ?></em>
 			<br />
 		<?php endif; ?>
 
-		<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'daw' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'daw' ),'  ','' ); ?></div>
+		<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'daw' ), get_comment_date(),  get_comment_time() ); ?></a></div>
 
 		<div class="comment-body"><?php comment_text(); ?></div>
 
 		<div class="reply">
 			<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+			<?php edit_comment_link( __( '(Edit)', 'daw' ),'  ','' ); ?>
 		</div>
 	</div>
 

+ 14 - 0
js/script.js

@@ -0,0 +1,14 @@
+$(document).ready(function() {
+  var commentsDiv = $('#comments');
+  if (commentsDiv.length) {
+    $(commentsDiv).hide();
+    $('.toggle-comments').on('click', function(e) {
+      e.preventDefault();
+      $(commentsDiv).toggle('slow', function() {
+        var anchor = $('.toggle-comments');
+        var anchorText = anchor.text() == 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
+        $(anchor).text(anchorText);
+      });
+    });
+  }
+});

+ 188 - 0
style.css

@@ -839,6 +839,194 @@ span.fb  {
 	span.fb:hover {
 		background-position: 0 0;
 	}
+	
+/* =Comments
+-------------------------------------------------------------- */
+
+.commentbubble {
+	font-size: 12px;
+	color: #777;
+	float: right;
+	margin: 0 55px 0 0;
+}
+.comment {
+	padding: 10px;
+}
+.commentbubble a.toogle-comments {
+	float: right;
+	text-align: right;
+}
+.comments-area {
+	background: #f5f5f5 url('../images/bg.jpg') no-repeat left top;
+	padding: 15px;
+}
+#content .comments-area p {
+	margin: 0 0 8px;
+	font-size: 13px;
+}
+#content .comments-area .reply {
+	margin: 5px 8px 0px;
+	padding: 2px 9px;
+	background: #ebeaea;
+	font-size: 11px;
+}
+.comments-title {
+	margin-bottom: 48px;
+	margin-bottom: 3.428571429rem;
+	font-size: 16px;
+	font-size: 1.142857143rem;
+	line-height: 1.5;
+	font-weight: normal;
+}
+.comments-area {
+	margin: 0px 50px;
+}
+.comments-area ul {
+	margin: 0px 0px;
+	list-style: none;
+}
+.comments-area h3 {
+	margin: 0 0 0;
+}
+.comments-meta  {
+	font-size: 10px;
+}
+.comments-area article {
+	margin: 24px 0;
+}
+.comments-area article header {
+	margin: 0 0 48px;
+	overflow: hidden;
+	position: relative;
+}
+.comments-area article header img {
+	float: left;
+	padding: 0;
+	line-height: 0;
+}
+.comments-area article header cite,
+.comments-area article header time {
+	display: block;
+	margin-left: 85px;
+}
+.comments-area article header cite {
+	font-style: normal;
+	font-size: 15px;
+}
+.comments-area cite b {
+	font-weight: normal;
+}
+.comments-area article header time {
+	text-decoration: none;
+	font-size: 12px;
+	color: #5e5e5e;
+}
+.comments-area article header a {
+	text-decoration: none;
+	color: #5e5e5e;
+}
+.comments-area article header a:hover {
+	color: #21759b;
+}
+.comments-area article header cite a {
+	color: #444;
+}
+.comments-area article header cite a:hover {
+	text-decoration: underline;
+}
+
+a.comment-reply-link,
+a.comment-edit-link {
+	color: #686868;
+	font-size: 13px;
+}
+a.comment-reply-link:hover,
+a.comment-edit-link:hover {
+	color: #21759b;
+}
+.commentlist .pingback {
+	line-height: 1.714285714;
+	margin-bottom: 24px;
+}
+li.comment.even {
+	background: #fff;
+}
+li.comment.odd {
+	background: #f3f3f3;
+}
+li.comment.thread-even {
+	background: #f5f5f5;
+}
+li.comment.thread-odd {
+	background: #fff;
+}
+.comment-meta {
+	font-size: 11px;
+	line-height: 12px;
+}
+.comment-meta a {
+	color: #777;
+	float: right;
+}
+
+/* Comment form */
+#respond {
+	margin-top: 10px;
+}
+#respond h3#reply-title {
+	margin: 0px 8px 0px;
+	padding: 2px 9px;
+	background: #ebeaea;
+	font-size: 11px;
+	margin: 0;
+}
+#respond h3#reply-title #cancel-comment-reply-link {
+	margin-left: 10px;
+	font-weight: normal;
+	font-size: 12px;
+	font-size: 0.857142857rem;
+}
+#respond form {
+	margin: 24px 0;
+	margin: 1.714285714rem 0;
+}
+#respond form p {
+	margin: 11px 0;
+	margin: 0.785714286rem 0;
+}
+#respond form p.logged-in-as {
+	margin-bottom: 24px;
+	margin-bottom: 1.714285714rem;
+}
+#respond form label {
+	display: block;
+	line-height: 1.714285714;
+}
+#respond form input[type="text"],
+#respond form textarea {
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	font: 0.857142857rem "Courier New", Courier, mono;
+	line-height: 1.714285714;
+	padding: 10px;
+	padding: 0.714285714rem;
+	width: 100%;
+}
+#respond form p.form-allowed-tags {
+	margin: 0;
+	font-size: 12px;
+	font-size: 0.857142857rem;
+	line-height: 2;
+	color: #5e5e5e;
+}
+.required {
+	color: red;
+}
+img.avatar {
+	width: 20px;
+	height: 20px;
+	margin: 0 0 -5px;
+}
 
 /* =Asides
 -------------------------------------------------------------- */