* Post format support for asides only, supported by CSS and not a template, is a good workable minimum for a theme so the post format templates are gone
* With good support for essential CSS in IE8+ it's not neccesary to have a ID on the HTML element for the version of IE
* Branding and site-generator are ugly id names
* The title and description are selectable by class for consistency and portability
This commit is contained in:
Ian Stewart 2012-01-10 20:43:34 +00:00
parent edfeccc255
commit db89577313
6 changed files with 11 additions and 174 deletions

View File

@ -1,36 +0,0 @@
<?php
/**
* The template for displaying posts in the Aside Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package _s
* @since _s 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', '_s' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php _s_posted_on(); ?>
<?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -1,86 +0,0 @@
<?php
/**
* The template for displaying posts in the Gallery Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package _s
* @since _s 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="entry-meta">
<?php _s_posted_on(); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php if ( post_password_required() ) : ?>
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', '_s' ) ); ?>
<?php else : ?>
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
<figure class="gallery-thumb">
<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</figure><!-- .gallery-thumb -->
<p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, '_s' ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?></em></p>
<?php endif; ?>
<?php the_excerpt(); ?>
<?php endif; ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', '_s' ) );
if ( $categories_list && _s_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( __( 'Posted in %1$s', '_s' ), $categories_list ); ?>
</span>
<span class="sep"> | </span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', '_s' ) );
if ( $tags_list ) :
?>
<span class="tag-links">
<?php printf( __( 'Tagged %1$s', '_s' ), $tags_list ); ?>
</span>
<span class="sep"> | </span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>
<?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); ?></span>
<span class="sep"> | </span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -1,30 +0,0 @@
<?php
/**
* The template for displaying posts in the Image Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package _s
* @since _s 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', '_s' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php _s_posted_on(); ?>
<?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', '_s' ), __( '1 Comment', '_s' ), __( '% Comments', '_s' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', '_s' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -12,12 +12,12 @@
</div><!-- #main -->
<footer id="colophon" role="contentinfo">
<div id="site-generator">
<div class="site-info">
<?php do_action( '_s_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', '_s' ) ); ?>" title="<?php esc_attr_e( 'A Semantic Personal Publishing Platform', '_s' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', '_s' ), 'WordPress' ); ?></a>
<span class="sep"> | </span>
<?php printf( __( 'Theme: %1$s by %2$s.', '_s' ), '_s', '<a href="http://automattic.com/" rel="designer">Automattic</a>' ); ?>
</div>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->

View File

@ -68,7 +68,7 @@ function _s_setup() {
/**
* Add support for the Aside and Gallery Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'gallery' ) );
add_theme_support( 'post-formats', array( 'aside', ) );
}
endif; // _s_setup

View File

@ -8,18 +8,7 @@
* @since _s 1.0
*/
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
@ -58,18 +47,18 @@
<body <?php body_class(); ?>>
<div id="page" class="hfeed">
<?php do_action( 'before' ); ?>
<header id="branding" role="banner">
<header id="masthead" role="banner">
<hgroup>
<h1 id="site-title"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
<h1 class="site-title"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<nav id="access" role="navigation">
<h1 class="assistive-text section-heading"><?php _e( 'Main menu', '_s' ); ?></h1>
<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', '_s' ); ?>"><?php _e( 'Skip to content', '_s' ); ?></a></div>
<nav role="navigation" class="site-navigation">
<h1 class="assistive-text"><?php _e( 'Main menu', '_s' ); ?></h1>
<div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', '_s' ); ?>"><?php _e( 'Skip to content', '_s' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #access -->
</header><!-- #branding -->
</nav>
</header><!-- #masthead -->
<div id="main">