windhamdavid 11 years ago
parent
commit
5f9016c5bb
5 changed files with 93 additions and 44 deletions
  1. 19 0
      comments.php
  2. 28 35
      functions.php
  3. 37 0
      inc/tweaks.php
  4. 7 7
      index.php
  5. 2 2
      style.css

+ 19 - 0
comments.php

@@ -0,0 +1,19 @@
+<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 ?>
+		<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>
+		</nav>
+		<?php endif;?>
+		<?php
+		if ( ! comments_open() && get_comments_number() ) : ?>
+		<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
+		<?php endif; ?>
+	<?php endif;?>
+	<?php comment_form(); ?>
+</div>

+ 28 - 35
functions.php

@@ -3,51 +3,17 @@
 if ( ! function_exists( 'dw_setup' ) ):
 function dw_setup() {
 	require( get_template_directory() . '/inc/template.php' );
+	require( get_template_directory() . '/inc/tweaks.php' );
 }
 endif; 
 add_action( 'after_setup_theme', 'dw_setup' );
 
-remove_action('wp_head', 'index_rel_link' ); 
-remove_action('wp_head', 'rel_canonical');
-remove_action('wp_head', 'start_post_rel_link', 10, 0 );
-remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); 
-remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
-remove_action('wp_head', 'parent_post_rel_link', 10, 0 );
-remove_action('wp_head', 'rsd_link');
-remove_action('wp_head', 'wlwmanifest_link');
-remove_action('wp_head', 'wp_generator');
-remove_action('wp_head', 'feed_links_extra', 3 );
-remove_action('wp_head', 'feed_links', 2 );
-
-add_editor_style();
 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_remove_wp_ver_css_js( $src ) {
-    if ( strpos( $src, 'ver=' ) )
-        $src = remove_query_arg( 'ver', $src );
-    return $src;
-}
-add_filter( 'style_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
-add_filter( 'script_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
-
-add_action( 'admin_head', 'dw_hide' );
-function dw_hide() {
-    ?>
-    <style type="text/css" media="screen">
-    #footer {display:none;}
-	#contextual-help-link-wrap {display: none;}
-	#wpadminbar {display: none;}
-	body.admin-bar #wpcontent, body.admin-bar #adminmenu {padding-top:0;}
-	html.wp-toolbar{padding-top:0;}
-	#postexcerpt p {display: none;}
-    </style>
-<?php }
-
-add_action( 'wp_enqueue_scripts', 'dw_scripts' );
 function dw_scripts() {
 	global $post;
 	wp_deregister_script('jquery');
@@ -58,5 +24,32 @@ function dw_scripts() {
 		wp_enqueue_script( 'comment-reply' );
 	}
 }
+add_action( 'wp_enqueue_scripts', 'dw_scripts' );
+
+function dw_editor() {
+    //add_editor_style( 'style.css' );
+}
+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) {
+	
+}
 
 ?>

+ 37 - 0
inc/tweaks.php

@@ -0,0 +1,37 @@
+<?php
+
+remove_action('wp_head', 'index_rel_link' ); 
+remove_action('wp_head', 'rel_canonical');
+remove_action('wp_head', 'start_post_rel_link', 10, 0 );
+remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); 
+remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
+remove_action('wp_head', 'parent_post_rel_link', 10, 0 );
+remove_action('wp_head', 'rsd_link');
+remove_action('wp_head', 'wlwmanifest_link');
+remove_action('wp_head', 'wp_generator');
+remove_action('wp_head', 'feed_links_extra', 3 );
+remove_action('wp_head', 'feed_links', 2 );
+
+function dw_remove_wp_ver_css_js( $src ) {
+    if ( strpos( $src, 'ver=' ) )
+        $src = remove_query_arg( 'ver', $src );
+    return $src;
+}
+add_filter( 'style_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
+add_filter( 'script_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
+
+
+function dw_hide() {
+    ?>
+    <style type="text/css" media="screen">
+    #footer {display:none;}
+	#contextual-help-link-wrap {display: none;}
+	#wpadminbar {display: none;}
+	body.admin-bar #wpcontent, body.admin-bar #adminmenu {padding-top:0;}
+	html.wp-toolbar{padding-top:0;}
+	#postexcerpt p {display: none;}
+    </style>
+<?php }
+add_action( 'admin_head', 'dw_hide' );
+
+?>

+ 7 - 7
index.php

@@ -5,20 +5,20 @@
 			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 				<div class="entry-content">
 					<div class="date">
-						<?php the_date(); ?>		
-							<div class="meta">
-								<?php dw_posted_at(); ?>
-								<p><small><?php edit_post_link('Edit');?></small><p>
-							</div>
+						<?php the_date('M j, Y g:i a '); ?>		
+						<div class="meta">
+							<?php dw_posted_at(); ?>
+							<p><small><?php edit_post_link('Edit');?></small><p>
+						</div>
 					</div>
 					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-
 					<?php the_content(); ?>
+					<?php comments_template( '', true ); ?>
 					<div class="clear">&nbsp;</div>
 					<div id="nav-below" class="navigation">
 						<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'daw' ) . '</span> %title' ); ?></div>
 						<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'daw' ) . '</span>' ); ?></div>
-					</div><!-- #nav-below -->
+					</div>
 				</div>
 			</div>
 			<?php endwhile; ?>

+ 2 - 2
style.css

@@ -808,8 +808,8 @@ body.page .edit-link {
 .date {
 	float: right;
 	margin: -20px 0 20px 50px;
-	color: #000;
-	font-family: "Courier New", Courier, mono;	
+	color: #777;
+	font: 14px/18px "Courier New", Courier, mono;
 }