Add Post Format support to TwentyTen. Can now use this to designate an Aside or a Gallery! see #14746

git-svn-id: https://develop.svn.wordpress.org/trunk@16197 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2010-11-05 02:25:41 +00:00
parent c44eb74f66
commit 2cc7354154
3 changed files with 5 additions and 5 deletions

View File

@ -77,8 +77,8 @@ function twentyten_setup() {
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Temporarily add Post Format support
add_theme_support( 'post-formats', array( 'aside', 'video', 'image' ) );
// Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );

View File

@ -57,7 +57,7 @@
<?php /* How to display posts in the Gallery category. */ ?>
<?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
<?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) || 'gallery' == get_post_format( $post->ID ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
@ -98,7 +98,7 @@
<?php /* How to display posts in the asides category */ ?>
<?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) ) : ?>
<?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) || 'aside' == get_post_format( $post->ID ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>

View File

@ -3,7 +3,7 @@ Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar.
Author: the WordPress team
Version: 1.1
Version: 1.2-alpha
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
*/