Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

New option functions #19

Closed
wants to merge 8 commits into from

2 participants

Jesper Johansen Tyler Longren
Jesper Johansen
jayj commented March 29, 2012

Create two new option functions. One to get the default options and one to return an array with the options. This will elimate the need of global variables.

You should also consider to remove the JS from header.php and footer.php, create a function and attach it to the wp_footer action so it runs after jQuery is included.

Ignore the two oldest commits. Apparently I didn't fix the problem and they're still in my pull requests.

added some commits March 28, 2012
Jesper Johansen Update readme and test if this thing is working 3aa8aa0
Jesper Johansen * Fix PHP notices because of undefined variables in the comment funct…
…ion.

* Make the comment markup cleanier and more HTML5 + some styling "fixing"
* The placeholder attributes on the comment fields have been removed. I don't really like them and IMO they just add clutter to the page.
* Clean up spacing issues in the affected functions (and a few more)
9b620f5
Jesper Johansen Use wp_enqueue_scripts() to add styles instead of wp_print_styles(). … 999e3c5
Jesper Johansen Create two new option functions. One to get the default options and o…
…ne to return an array with the options. This will elimate the need of global variables.
391526a
Jesper Johansen Update attachments.php
* Use the new option functions
* Fix notice caused by lowercase $post->id
* Code clean-up
* Use of printf in the i18n strings
e989f99
Jesper Johansen Update footer.php to the new option functions and make use of printf …
…to make it easier for translators to translate.

@suggestion Move the JS out of this file into their own function and attach it the wp_footer action.
1a5206d
Jesper Johansen Update header.php to the new options functions.
Also specify 'theme_location' in the wp_nav_menu() call.
e298231
Jesper Johansen Update the comment pagination in comments.php to match each other. 110828e
Tyler Longren
Owner

I pulled these changes in manually.

Tyler Longren tlongren closed this March 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 8 unique commits by 1 author.

Mar 28, 2012
Jesper Johansen Update readme and test if this thing is working 3aa8aa0
Jesper Johansen * Fix PHP notices because of undefined variables in the comment funct…
…ion.

* Make the comment markup cleanier and more HTML5 + some styling "fixing"
* The placeholder attributes on the comment fields have been removed. I don't really like them and IMO they just add clutter to the page.
* Clean up spacing issues in the affected functions (and a few more)
9b620f5
Mar 29, 2012
Jesper Johansen Use wp_enqueue_scripts() to add styles instead of wp_print_styles(). … 999e3c5
Jesper Johansen Create two new option functions. One to get the default options and o…
…ne to return an array with the options. This will elimate the need of global variables.
391526a
Jesper Johansen Update attachments.php
* Use the new option functions
* Fix notice caused by lowercase $post->id
* Code clean-up
* Use of printf in the i18n strings
e989f99
Jesper Johansen Update footer.php to the new option functions and make use of printf …
…to make it easier for translators to translate.

@suggestion Move the JS out of this file into their own function and attach it the wp_footer action.
1a5206d
Jesper Johansen Update header.php to the new options functions.
Also specify 'theme_location' in the wp_nav_menu() call.
e298231
Jesper Johansen Update the comment pagination in comments.php to match each other. 110828e
This page is out of date. Refresh to see the latest.
38  README.markdown
Source Rendered
... ...
@@ -1,37 +1 @@
1  
-html5press
2  
-==================
3  
-html5press is a theme for WordPress based on [a design by Jesper](http://jayj.dk/2009/a-free-html5-and-css3-theme/ "Original work").
4  
-
5  
-
6  
-Background
7  
------------------------------
8  
-I thought Jesper's stuff looked nice, and no WordPress theme existed yet based on his HTML5 template. So here this is. Really though, most of the credit goes to Jesper, without his work this theme would not exist.
9  
-
10  
-
11  
-Demo
12  
------------------------------
13  
-You can find [a demo here](http://html5press.com/ "HTML5Press Demo") and a screenshot below.
14  
-
15  
-![HTML5Press Screenshot](https://github.com/tlongren/html5press/raw/master/screenshot.png "HTML5Press Screenshot")
16  
-
17  
-
18  
-Notes
19  
------------------------------
20  
-1. __Archive Page__: There's a page template called Archives. Don't enter any page content, just title the page and select Archives for the page template. The archives will be generated automatically. See [here for an example](http://html5press.com/archives/ "HTML5Press Archives Demo").
21  
-
22  
-2. __Link Post Format__: To utilize the link Post Format, simply write a new post and select "Link" for the format. You'll also need to add a custom field with the URL you want to link to. The custom field name should be __LinkFormatURL__ and the custom field value should be the URL you want to link to.
23  
-
24  
-3. __Quote Post Format__: When using this post format, I usually use the author or source as the post title, and then put the quote inside a blockquote for the actual post content.
25  
-
26  
-4. __Status Post Format__: Just put your status as the post title and publish (make sure you select the status format!). No post content is necessary.
27  
-
28  
-5. __Maintenance Mode__: This option lets you show a "maintenance" message to visitors who aren't logged in. This can be useful while making changes to your website or while tinkering with HTML5Press. Just don't forget to disable it when you're done or your visitors won't see your site!
29  
-
30  
-6. __Fuzzy Timestamps__: Enabling fuzzy timestamps on the options page will cause dates/times to display like "two days ago" or "4 hours ago", instead of dates showing "10/07/2011 11:23:34".
31  
-
32  
-7. __Twitter Widget__: A custom twitter widget is included with HTML5Press as of version 2.1. This widget is based on the [Simple Twitter Widget](https://github.com/matthiassiegel/Simple-Twitter-Widget "Simple Twitter Widget") by [Matthias Siegel](http://chipsandtv.com "Matthias Siegel Home Page"). Matthias graciously allowed me to include his code in HTML5Press.
33  
-
34  
-
35  
-Other Considerations
36  
------------------------------
37  
-A majority of the images included in HTML5Press are from the [iconic icon set](http://somerandomdude.com/projects/iconic/ "Iconic Icons!") by [P.J. Onori](http://somerandomdude.com/ "Some Random Dude"). Images from Iconic are the tag, sticky post identifier, link post format identifier, status post format identifier, quote post format identifier and left and right arrows. I will likely use more images from Iconic as I add additional features/post formats to HTML5Press.
  1
+Forked from [HTML5Press by Tyler Longren](https://github.com/tlongren/html5press)
91  attachment.php
... ...
@@ -1,36 +1,69 @@
1 1
 <?php get_header(); ?>
2  
-<?php global $html5press_options; $html5press_settings = get_option( 'html5press_options', $html5press_options ); ?>
  2
+
  3
+<?php
  4
+	$options = html5press_get_options();
  5
+?>
  6
+
3 7
 <div id="content" role="main">
4  
-		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
5  
-        <article <?php post_class(); ?>>
6  
-        
7  
-            <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
8  
-			<div class="alignleft prev-post"><?php previous_image_link(false,__('Previous Attachment','html5press')); ?></div><div class="alignright next-post"><?php next_image_link(false,__('Next Attachment','html5press')); ?></div>
9  
-			<div class="clear"></div>
10  
-<?php if ( wp_attachment_is_image( $post->id ) ) : $att_image = wp_get_attachment_image_src( $post->id, "medium"); $large_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $html5press_settings['featured_image_size'] ); ?>
  8
+
  9
+	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  10
+
  11
+	<article <?php post_class(); ?>>
  12
+	
  13
+		<h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  14
+
  15
+		<div class="alignleft prev-post">
  16
+			<?php previous_image_link( false, __( 'Previous Attachment', 'html5press' ) ); ?>
  17
+		</div>
  18
+
  19
+		<div class="alignright next-post">
  20
+			<?php next_image_link( false, __( 'Next Attachment','html5press' ) ); ?>
  21
+		</div>
  22
+		
  23
+		<div class="clear"></div>
  24
+
  25
+		<?php
  26
+			if ( wp_attachment_is_image() ) :
  27
+				$att_image   = wp_get_attachment_image_src( $post->ID, 'medium' );
  28
+				$large_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $options['featured_image_size'] );
  29
+				$excerpt     = $post->post_excerpt;
  30
+		?>
  31
+
11 32
 			<figure>
12  
-			<a href="<?php echo "$large_image[0]"; ?>" title="<?php the_title(); ?>" rel="lightbox"><img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>"  class="attachment-medium" alt="<?php $post->post_excerpt; ?>" /></a>
13  
-			<figcaption><?php if ( !empty($post->post_excerpt) ) echo "$post->post_excerpt" ?></figcaption>
  33
+				<a href="<?php echo esc_url( $large_image[0] ); ?>" title="<?php the_title(); ?>" rel="lightbox">
  34
+					<img src="<?php echo esc_url( $att_image[0] ); ?>" width="<?php echo esc_attr( $att_image[1] ); ?>" height="<?php echo esc_attr( $att_image[2] ); ?>" class="attachment-medium" alt="<?php esc_attr( $excerpt ); ?>" />
  35
+				</a>
  36
+
  37
+				<figcaption><?php if ( ! empty( $excerpt ) ) echo $excerpt; ?></figcaption>
14 38
 			</figure>
15  
-			<p><a href="<?php echo get_permalink($post->post_parent); ?>">&laquo;<?php _e( 'Back to Post','html5press' ); ?></a></p>
16  
-<?php else : ?>
17  
-			<a href="<?php echo wp_get_attachment_url($post->ID) ?>" title="<?php echo esc_html( get_the_title($post->ID), 1 ) ?>" rel="attachment"><?php echo basename($post->guid) ?></a>
18  
-			<div><?php if ( !empty($post->post_excerpt) ) echo "$post->post_excerpt" ?></div>
19  
-<?php endif; ?>
20  
-			<?php /* Edit Link */ edit_post_link(); ?>
21  
-			<footer class="post-meta">
22  
-                <p>
23  
-                	<?php _e( 'Created ','html5press'); ?><time datetime="<?php the_time('Y-m-d\TH:i:sO'); ?>" pubdate><?php the_time( get_option( 'date_format' ) ); ?></time>
24  
-				</p>
25  
-				
26  
-            </footer> <!-- end post meta -->
27  
-			<article class="comments">
28  
-				<?php comments_template(); ?>
29  
-			</article>
30  
-        </article> <!-- end post 1 -->
31  
-		<?php endwhile; endif; ?>
32  
-    
33  
-    </div> <!-- end main -->
  39
+
  40
+			<p><a href="<?php echo get_permalink( $post->post_parent ); ?>">&laquo;<?php _e( 'Back to Post','html5press' ); ?></a></p>
  41
+
  42
+		<?php else : ?>
  43
+
  44
+			<a href="<?php echo wp_get_attachment_url($post->ID) ?>" title="<?php echo esc_html( get_the_title($post->ID), 1 ) ?>" rel="attachment"><?php echo basename( $post->guid ); ?></a>
  45
+		
  46
+			<div><?php if ( ! empty( $excerpt ) ) echo $excerpt; ?></div>
  47
+
  48
+		<?php endif; ?>
  49
+
  50
+		<?php /* Edit Link */ edit_post_link(); ?>
  51
+
  52
+		<footer class="post-meta">
  53
+			<p>
  54
+				<?php printf( __( 'Created on %s', 'html5press' ), '<time datetime="' . get_the_date('Y-m-d\TH:i:sO') . '" pubdate>' . get_the_date( get_option( 'date_format' ) ) . '</time>' ); ?>
  55
+			</p>
  56
+		</footer> <!-- .post-meta -->
  57
+
  58
+		<article class="comments">
  59
+			<?php comments_template(); ?>
  60
+		</article>
  61
+
  62
+	</article> <!-- end post 1 -->
  63
+
  64
+	<?php endwhile; endif; ?>
  65
+	
  66
+</div> <!-- #content -->
34 67
 
35 68
 <?php get_sidebar(); ?>
36 69
 
17  comments.php
@@ -13,7 +13,8 @@
13 13
  */
14 14
 ?>
15 15
 
16  
-			<div id="comments">
  16
+<div id="comments">
  17
+
17 18
 <?php if ( post_password_required() ) : ?>
18 19
 				<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.','html5press' ); ?></p>
19 20
 			</div><!-- #comments -->
@@ -37,15 +38,14 @@
37 38
 			?></h3>
38 39
 
39 40
 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
40  
-			<div class="navigation">
  41
+			<nav class="navigation clearfix">
  42
+				<h2 class="assistive-text"><?php _e( 'Comment navigation', 'html5press' ); ?></h2> 
41 43
 				<div class="nav-previous alignleft"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments','html5press' ) ); ?></div>
42 44
 				<div class="nav-next alignright"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>','html5press' ) ); ?></div>
43  
-			</div> <!-- .navigation -->
44  
-			<div class="clear"></div>
  45
+			</nav> <!-- .navigation -->
45 46
 <?php endif; // check for comment navigation ?>
46 47
 
47 48
 			<ol class="commentlist">
48  
-			
49 49
 				<?php
50 50
 					/* Loop through and list the comments. Tell wp_list_comments()
51 51
 					 * to use html5press_list_comments() to format the comments.
@@ -55,13 +55,12 @@
55 55
 				?>
56 56
 			</ol>
57 57
 
58  
-<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
59  
-			<h2 class="assistive-text"><?php _e( 'Comment navigation', 'html5press' ); ?></h2> 
60  
-			<nav class="navigation">
  58
+<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> 
  59
+			<nav class="navigation clearfix">
  60
+				<h2 class="assistive-text"><?php _e( 'Comment navigation', 'html5press' ); ?></h2> 
61 61
 				<div class="nav-previous alignleft"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments','html5press' ) ); ?></div>
62 62
 				<div class="nav-next alignright"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>','html5press' ) ); ?></div>
63 63
 			</nav> <!-- .navigation -->
64  
-			<div class="clear"></div>
65 64
 <?php endif; // check for comment navigation ?>
66 65
 
67 66
 <?php else : // or, if we don't have comments:
71  footer.php
... ...
@@ -1,38 +1,57 @@
133  functions.php
@@ -13,7 +13,7 @@ function html5press_layout_view() {
13 13
 // Set html5press version
14 14
 define( 'html5press_version', '2.3-rc2' );
15 15
 function html5press_getinfo( $show = '' ) {
16  
-        $output = '';
  16
+		$output = '';
17 17
 
18 18
 		switch ( $show ) {
19 19
 			case 'version' :
@@ -59,33 +59,42 @@ function html5press_register_scripts() {
59 59
 	wp_deregister_script( 'jquery' );
60 60
 	wp_enqueue_script( 'jquery', includes_url( 'js/jquery/jquery.js' ), array( 'modernizr' ), null );
61 61
 	wp_enqueue_script( 'easing', get_stylesheet_directory_uri() . '/js/easing.min.js', array( 'jquery' ), '1.1.2', true );
  62
+
62 63
 	global $html5press_options; $html5press_settings = get_option( 'html5press_options', $html5press_options );
  64
+
63 65
 	// If back to top is enabled, add easing and the back to top javascript.
64 66
 	if ( $html5press_settings['back_to_top'] == 1 ) {
65 67
 		wp_enqueue_script( 'totop', get_stylesheet_directory_uri() . '/js/jquery.ui.totop.js', array( 'jquery' ), '1.1', true );
66 68
 	}
  69
+
67 70
 	if ( $html5press_settings['enable_slimbox'] == 1 ) {
68 71
 		wp_enqueue_script( 'slimbox2', get_stylesheet_directory_uri() . '/js/slimbox2.js', array( 'jquery' ), '2.04', true );
69 72
 	}
  73
+
70 74
 	if ( !empty($html5press_settings['featured_cat']) ) {
71 75
 		wp_enqueue_script( 'bxslider', get_stylesheet_directory_uri() . '/js/jquery.bxSlider.min.js', array( 'jquery' ), '3.0', true );
72 76
 		wp_enqueue_script( 'bxslider-load', get_stylesheet_directory_uri() . '/js/bxslider-load.js', array( 'bxslider' ), '1.0', true );
73 77
 	}
  78
+	
74 79
 	if ( $html5press_settings['fuzzy_timestamps'] == 1 ) {
75 80
 		wp_enqueue_script( 'timeago', get_stylesheet_directory_uri() . '/js/jquery.timeago.js', array( 'jquery' ), '0.9.3', true );
76 81
 	}
77 82
 }
78 83
 
79 84
 // Register styles to accompany the scripts above
80  
-add_action( 'wp_print_styles', 'html5press_register_styles' );
  85
+add_action( 'wp_enqueue_scripts', 'html5press_register_styles' );
  86
+
81 87
 function html5press_register_styles() {
82 88
 	global $html5press_options; $html5press_settings = get_option( 'html5press_options', $html5press_options );
  89
+
83 90
 	if ( !empty($html5press_settings['featured_cat']) ) {
84 91
 		wp_enqueue_style( 'bxslider-style', get_stylesheet_directory_uri().'/css/bx_styles.css');
85 92
 	}
  93
+
86 94
 	if ( $html5press_settings['enable_slimbox'] == 1 ) {
87 95
 		wp_enqueue_style( 'slimbox2-style', get_stylesheet_directory_uri().'/css/slimbox2.css');
88 96
 	}
  97
+
89 98
 	wp_enqueue_style( 'fonts', get_stylesheet_directory_uri().'/css/fonts/'.$html5press_settings['theme_font'].'.css');
90 99
 }
91 100
 
@@ -132,52 +141,66 @@ function html5press_sidebars() {
132 141
 }
133 142
 
134 143
 // Setup comments form
135  
-add_filter('comment_form_default_fields', 'html5press_comments');
  144
+add_filter( 'comment_form_default_fields', 'html5press_comments' );
  145
+
136 146
 function html5press_comments() {
137  
-	$req = get_option('require_name_email');
138  
-	$fields =  array(
139  
-'author' => '<p><label for="author">' . __( 'Name','html5press' ) . '' . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 
140  
-'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' placeholder = "What should we call you?"' . ( $req ? ' required' : '' ) . '/></p>',
  147
+	$commenter = wp_get_current_commenter();
  148
+	$req       = get_option( 'require_name_email' );
  149
+	$aria_req  = ( $req ? " aria-required='true'" : '' );
  150
+
  151
+	$fields = array(
  152
+		'author' => '<p><label for="author">' . __( 'Name','html5press' ) . '' . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 
  153
+		'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ( $req ? ' required' : '' ) . '/></p>',
141 154
 
142  
-'email'  => '<p><label for="email">' . __( 'Email','html5press' ) . '' . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 
143  
-'<input id="email" name="email" type="email" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' placeholder="How can we reach you?"' . ( $req ? ' required' : '' ) . ' /></p>',
  155
+		'email' => '<p><label for="email">' . __( 'Email','html5press' ) . '' . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 
  156
+		'<input id="email" name="email" type="email" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ( $req ? ' required' : '' ) . ' /></p>',
  157
+
  158
+		'url' => '<p><label for="url">' . __( 'Website','html5press' ) . '</label>' .
  159
+		'<input id="url" name="url" type="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>'
  160
+	);
144 161
 
145  
-'url'    => '<p><label for="url">' . __( 'Website','html5press' ) . '</label>' .
146  
-'<input id="url" name="url" type="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" placeholder="Have you got a website?" /></p>'
147  
-);
148 162
 	return $fields;
149 163
 }
150 164
 
151 165
 // Setup actual comment form field
152 166
 add_filter('comment_form_field_comment', 'html5press_commentfield');
  167
+
153 168
 function html5press_commentfield() {
154  
-	$commentArea = '<p><label for="comment">' . _x( 'Comment','noun','html5press' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required placeholder="What\'s on your mind?"></textarea></p>';
155  
-	return $commentArea;
  169
+	return '<p><label for="comment">' . _x( 'Comment','noun','html5press' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required></textarea></p>';
156 170
 }
157 171
 
158 172
 // Show comments the HTML5Press way
159  
-function html5press_list_comments($comment, $args, $depth) {
  173
+function html5press_list_comments( $comment, $args, $depth ) {
  174
+
160 175
 	$GLOBALS['comment'] = $comment; ?>
161  
-   <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
162  
-     <div id="comment-<?php comment_ID(); ?>">
163  
-      <div class="comment-author vcard">
164  
-         <?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
165  
-
166  
-         <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>','html5press'), get_comment_author_link()) ?>
167  
-      </div>
168  
-      <?php if ($comment->comment_approved == '0') : ?>
169  
-         <em><?php _e( 'Your comment is awaiting moderation.','html5press' ) ?></em>
170  
-         <br />
171  
-      <?php endif; ?>
172  
-
173  
-      <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time pubdate datetime="<?php comment_time( 'Y-m-d\TH:i:s' ); ?>" class="timeago"><?php printf( '%1$s at %2$s', get_comment_date(),  get_comment_time() ); ?></time></a><?php edit_comment_link(__('(Edit)','html5press'),'  ','') ?></div>
174  
-		
175  
-      <?php comment_text() ?>
176 176
 
177  
-      <div class="reply">
178  
-         <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
179  
-      </div>
180  
-     </div>
  177
+	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  178
+		<div id="comment-<?php comment_ID(); ?>">
  179
+
  180
+			<footer class="comment-meta">
  181
+				<div class="comment-author vcard">
  182
+					<?php echo get_avatar( $comment, 48 ); ?>
  183
+
  184
+					<?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>', 'html5press' ), get_comment_author_link() ); ?>
  185
+				</div> <!-- .comment-author.vcard -->
  186
+
  187
+				<?php if ($comment->comment_approved == '0') : ?>
  188
+					<em><?php _e( 'Your comment is awaiting moderation.', 'html5press' ) ?></em>
  189
+					<br />
  190
+				<?php endif; ?>
  191
+
  192
+				<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
  193
+					<time pubdate datetime="<?php comment_time( 'Y-m-d\TH:i:s' ); ?>" class="timeago"><?php printf( '%1$s at %2$s', get_comment_date(),  get_comment_time() ); ?></time>
  194
+				</a>
  195
+				<?php edit_comment_link( __( '(Edit)', 'html5press' ), '', '' ); ?>
  196
+			</footer> <!-- .comment-meta -->
  197
+
  198
+			<div class="comment-content"><?php comment_text(); ?></div>
  199
+
  200
+			<div class="reply">
  201
+				<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  202
+			</div> <!-- .reply -->
  203
+		</div> <!-- #comment-<?php comment_ID() ?> -->
181 204
 <?php
182 205
 }
183 206
 
@@ -251,23 +274,23 @@ function html5press_excerpt_length($length) {
251 274
 // Link post titles to the link for link post formats
252 275
 add_filter('post_link', 'html5press_link_filter', 10, 2);
253 276
 function html5press_link_filter($link, $post) {
254  
-     if (has_post_format('link', $post) && get_post_meta($post->ID, 'LinkFormatURL', true)) {
255  
-          $link = get_post_meta($post->ID, 'LinkFormatURL', true);
256  
-     }
257  
-     return $link;
  277
+	 if (has_post_format('link', $post) && get_post_meta($post->ID, 'LinkFormatURL', true)) {
  278
+		  $link = get_post_meta($post->ID, 'LinkFormatURL', true);
  279
+	 }
  280
+	 return $link;
258 281
 }
259 282
 
260 283
 // Add featured post images to RSS feed
261 284
 add_filter('the_excerpt_rss', 'html5press_feed_thumbnail');
262 285
 add_filter('the_content_feed', 'html5press_feed_thumbnail');
263 286
 function html5press_feed_thumbnail($content) {
264  
-    global $post;
265  
-    if(has_post_thumbnail($post->ID)) {
266  
-        $content = '<p>' . get_the_post_thumbnail($post->ID,array(200,200)) .
267  
-        '</p>' . get_the_content();
268  
-    }
  287
+	global $post;
  288
+	if(has_post_thumbnail($post->ID)) {
  289
+		$content = '<p>' . get_the_post_thumbnail($post->ID,array(200,200)) .
  290
+		'</p>' . get_the_content();
  291
+	}
269 292
 
270  
-    return $content;
  293
+	return $content;
271 294
 }
272 295
 
273 296
 // Add rel="lightbox" to images embedded in a post for greater slimbox2 usage
@@ -275,9 +298,9 @@ function html5press_feed_thumbnail($content) {
275 298
 function html5press_addlightboxrel($content) {
276 299
 	global $post;
277 300
 	$pattern = "/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
278  
-  	$replacement = '<a$1href=$2$3.$4$5 rel="lightbox" title="'.$post->post_title.'"$6>';
279  
-    $content = preg_replace($pattern, $replacement, $content);
280  
-    return $content;
  301
+	$replacement = '<a$1href=$2$3.$4$5 rel="lightbox" title="'.$post->post_title.'"$6>';
  302
+	$content = preg_replace($pattern, $replacement, $content);
  303
+	return $content;
281 304
 }
282 305
 
283 306
 // Add rel="lightbox" to gallery images and make a set out of them for next/prev functionality
@@ -285,7 +308,7 @@ function html5press_addlightboxrel($content) {
285 308
 function html5press_addlightboxrel_to_gallery( $attachment_link ) {
286 309
 	global $post;
287 310
 	$pattern = "/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
288  
-  	$replacement = '<a$1href=$2$3.$4$5 rel="lightbox-gallery" title="'.$post->post_title.'"$6>';
  311
+	$replacement = '<a$1href=$2$3.$4$5 rel="lightbox-gallery" title="'.$post->post_title.'"$6>';
289 312
 	$content = preg_replace($pattern, $replacement, $attachment_link);
290 313
 	return $content;
291 314
 }
@@ -435,19 +458,19 @@ function widget($args, $instance) {
435 458
 						// Make links and Twitter names clickable
436 459
 						if ($clickable) :
437 460
 							// Match URLs
438  
-				    	$text = preg_replace('`\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))`', '<a href="$0">$0</a>', $text);
  461
+						$text = preg_replace('`\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))`', '<a href="$0">$0</a>', $text);
439 462
 
440  
-				    	// Match @name
441  
-				    	$text = preg_replace('/(@)([a-zA-Z0-9\_]+)/', '@<a href="https://twitter.com/$2">$2</a>', $text);
442  
-				    	
443  
-				    	// Match #hashtags
444  
-				    	$text = preg_replace('/(#)([a-zA-Z0-9\_]+)/', '#<a href="http://twitter.com/search/%23$2">$2</a>', $text);
  463
+						// Match @name
  464
+						$text = preg_replace('/(@)([a-zA-Z0-9\_]+)/', '@<a href="https://twitter.com/$2">$2</a>', $text);
  465
+						
  466
+						// Match #hashtags
  467
+						$text = preg_replace('/(#)([a-zA-Z0-9\_]+)/', '#<a href="http://twitter.com/search/%23$2">$2</a>', $text);
445 468
 						endif;
446 469
 
447 470
 					// Display date/time
448 471
 						if ($datedisplay) $result .= '
449 472
 								<span class="twitter-date"><a href="'. $t->get_permalink() .'"><time datetime="'.$html5time.'" class="timeago" pubdate>' . $time . '</time></a></span>' . ($datebreak ? '<br />' : ' - ');
450  
-			    	// Display message without username prefix
  473
+					// Display message without username prefix
451 474
 						$prefixlen = strlen($username . ": ");
452 475
 						$result .= '
453 476
 								<span class="twitter-text">' . substr($text, $prefixlen, strlen($text) - $prefixlen) . '</span>';
55  header.php
... ...
@@ -1,44 +1,63 @@
1  
-<?php global $html5press_options; $html5press_settings = get_option( 'html5press_options', $html5press_options ); if (!isset($html5press_settings['theme_color'])) { $html5press_settings['theme_color'] = "pink"; } ?>
  1
+<?php
  2
+	$options = html5press_get_options();
  3
+?>
2 4
 <!doctype html>
3 5
 <!--[if lt IE 7]> <html class="no-js ie6" <?php language_attributes(); ?>> <![endif]-->
4 6
 <!--[if IE 7]>    <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
5 7
 <!--[if IE 8]>    <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
6 8
 <!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
7 9
 <head>
8  
-
9  
-    <meta charset="utf-8" />
10  
-    
11  
-    <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
  10
+	<meta charset="utf-8" />
  11
+	
  12
+	<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
12 13
 	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
13  
-    
14  
-    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
  14
+	
  15
+	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
15 16
 	
16 17
 	<!-- Mobile viewport optimized: j.mp/bplateviewport -->
17  
- 	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
  18
+	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
18 19
 	<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />
19  
-	<link href="<?php echo get_stylesheet_directory_uri(); ?>/css/<?php echo esc_attr( $html5press_settings['theme_color'] ); ?>.css" rel="stylesheet" />
20  
-    
  20
+	<link href="<?php echo get_stylesheet_directory_uri(); ?>/css/<?php echo esc_attr( $options['theme_color'] ); ?>.css" rel="stylesheet" />
  21
+	
21 22
 	<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
22  
-<?php wp_head(); ?>
23  
-<?php if ( !empty($html5press_settings['custom_css']) ) { ?><style type="text/css"><?php echo $html5press_settings['custom_css']; ?></style><?php } ?>
  23
+	
  24
+	<?php wp_head(); ?>
  25
+
  26
+	<?php if ( ! empty( $options['custom_css'] ) ) { ?>
  27
+		<style><?php echo $options['custom_css']; ?></style>
  28
+	<?php } ?>
24 29
 </head>
25 30
 
26 31
 <body <?php body_class(); ?>>
27 32
 
28 33
 <div id="wrapper">
29 34
 
30  
-    <header id="header" class="clearfix" role="banner">
  35
+	<header id="header" class="clearfix" role="banner">
31 36
 	
32 37
 		<hgroup>
33  
-			<h1 id="site-title"><a href="<?php echo home_url(); ?>"><?php if (empty($html5press_settings['custom_logo_url'])) { bloginfo('name'); } else { ?><img src="<?php echo $html5press_settings['custom_logo_url']; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" /><?php } ?></a></h1>
34  
-			<?php if ($html5press_settings['show_tagline'] == 1) { ?><h2 id="site-description"><?php bloginfo('description'); ?></h2><?php } ?>
  38
+			<h1 id="site-title">
  39
+				<a href="<?php echo home_url(); ?>">
  40
+					<?php
  41
+						if ( empty( $options['custom_logo_url'] ) ) {
  42
+							bloginfo( 'name' );
  43
+						} else {
  44
+					?>
  45
+						<img src="<?php echo esc_url( $options['custom_logo_url'] ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" />
  46
+					<?php } ?>
  47
+				</a>
  48
+			</h1>
  49
+
  50
+			<?php if ( $options['show_tagline'] ) { ?>
  51
+				<h2 id="site-description"><?php bloginfo('description'); ?></h2>
  52
+			<?php } ?>
35 53
 		</hgroup>
36 54
 		
37  
-    </header> <!-- end header -->
  55
+	</header> <!-- end header -->
38 56
 
39 57
 <div id="main" class="clearfix">
40  
-    <!-- Navigation -->
  58
+	
  59
+	<!-- Navigation -->
41 60
 	<nav id="menu" class="clearfix" role="navigation">
42 61
 		<h2 class="assistive-text"><?php _e( 'Main menu', 'html5press' ); ?></h2> 
43  
-		<?php wp_nav_menu( array( 'menu' => 'top-menu', 'container' => 'false' ) ); ?>
  62
+		<?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'menu' => 'top-menu', 'container' => 'false' ) ); ?>
44 63
 	</nav> <!-- #nav -->
35  style.css
@@ -11,9 +11,9 @@ License URI: license.txt
11 11
 */
12 12
 
13 13
 /**
14  
- * HTML5 And CSS3 Theme version 2.0
  14
+ * Jayj HTML5 theme 2.0
15 15
  * By Jayj.dk 
16  
- * Download for free at http://jayj.dk/a-free-html5-and-css3-theme/
  16
+ * Download for free at http://jayj.dk/free-html5-css3-theme/
17 17
  
18 18
 	Released under New BSD License
19 19
 	http://www.opensource.org/licenses/bsd-license.php
@@ -81,14 +81,13 @@ q:before, q:after { content: ""; content: none; }
81 81
  
82 82
 body { 
83 83
     color: #333;
84  
-    font: 16px/28px Georgia, 'Times New Roman', Times, serif;
  84
+    font: 16px/28px Georgia, serif;
85 85
     
86 86
     /* CSS3 gradient background pattern @credits http://leaverou.me/demos/css3-patterns.html */
87 87
     background: url(images/bg.png) repeat fixed; /* Image fallback for Firefox and browsers who don't support gradients */ 
88 88
 
89 89
     background-color: #eee; /* Change this to change both stribe colors */
90 90
 
91  
-
92 91
     background-image: -webkit-gradient(linear, 0 100%, 100% 0,
93 92
                             color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),
94 93
                             color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)),
@@ -915,9 +914,11 @@ a#toTop:hover {
915 914
 	padding: 0 4px 5px;
916 915
 }
917 916
 #main #gallery-1 .gallery-item {width:auto !important;}
918  
-/* Comments */
  917
+
  918
+
919 919
 /* =Comments
920 920
 -------------------------------------------------------------- */
  921
+
921 922
 /* Comments link */
922 923
 .hentry .comments-link a {
923 924
 	background: url(images/comment-bubble.png) no-repeat right top;
@@ -946,10 +947,9 @@ a#toTop:hover {
946 947
 	margin: 0;
947 948
 }
948 949
 .commentlist li.comment {
949  
-	border-bottom:thin solid #464646;
950  
-	line-height: 24px;
  950
+	border-bottom: 1px solid #464646;
951 951
 	margin: 0 0 24px 0;
952  
-	padding: 0 0 0 56px;
  952
+	padding: 10px 0 10px 56px;
953 953
 	position: relative;
954 954
 }
955 955
 /*
@@ -973,9 +973,20 @@ a#toTop:hover {
973 973
 }
974 974
 .commentlist .avatar {
975 975
 	position: absolute;
976  
-	top: 4px;
977  
-	left: 0;
  976
+	top: 7px;
  977
+	left: 5px;
  978
+}
  979
+
  980
+.comment-meta {
  981
+	font-size: 14px;
  982
+	line-height: 1.6;
  983
+	margin: 0 0 15px 10px;
978 984
 }
  985
+
  986
+.reply {
  987
+	font-size: 14px;
  988
+}
  989
+
979 990
 .comment-author {
980 991
 }
981 992
 .comment-author cite {
@@ -1033,10 +1044,10 @@ h3#reply-title {
1033 1044
 }
1034 1045
 #respond label {
1035 1046
 	color: #333;
1036  
-	font-size: 12px;
  1047
+	font-size: 13px;
1037 1048
 }
1038 1049
 #respond input {
1039  
-	margin: 0 0 9px;
  1050
+	margin: 0 0 20px;
1040 1051
 	width: 95%;
1041 1052
 }
1042 1053
 #respond textarea {
31  theme-options.php
... ...
@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 
3 3
 // Default options values
  4
+// Kept for back-compat for now because I don't want to convert all the option calls to the new before I've heard your opinion
4 5
 $html5press_options = array(
5 6
 	'back_to_top' => true,
6 7
 	'show_tagline' => true,
@@ -18,6 +19,36 @@
18 19
 	'homepage_article_summary' => false
19 20
 );
20 21
 
  22
+/**
  23
+ * Returns the default options for HTML5Press
  24
+ */
  25
+function html5press_get_default_options() {
  26
+	return array(
  27
+		'back_to_top' => true,
  28
+		'show_tagline' => true,
  29
+		'enable_slimbox' => false,
  30
+		'show_query_stats' => false,
  31
+		'fuzzy_timestamps' => false,
  32
+		'maintenance_mode' => false,
  33
+		'custom_logo_url' => '',
  34
+		'featured_image_size' => 'large',
  35
+		'theme_color' => 'pink',
  36
+		'theme_font' => 'droid-serif',
  37
+		'featured_cat' => '',
  38
+		'num_featured' => '5',
  39
+		'custom_css' => '',
  40
+		'homepage_article_summary' => false
  41
+	);
  42
+}
  43
+
  44
+/**
  45
+ * Returns the options array for HTML5Press.
  46
+ */
  47
+function html5press_get_options() {
  48
+	return get_option( 'html5press_options', html5press_get_default_options() );
  49
+}
  50
+
  51
+
21 52
 if ( is_admin() ) : // Load only if we are viewing an admin page
22 53
 
23 54
 function html5press_register_settings() {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.