>
diff --git a/wp-content/themes/default/search.php b/wp-content/themes/default/search.php index 910b65ec8a..17ee99c5e1 100644 --- a/wp-content/themes/default/search.php +++ b/wp-content/themes/default/search.php @@ -14,7 +14,7 @@ -
+
>
- diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php index b3bf7863c7..5c09870e1a 100644 --- a/wp-content/themes/default/single.php +++ b/wp-content/themes/default/single.php @@ -9,7 +9,7 @@
+
id="post-">
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index 260f3f7ede..33e466dd58 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -173,16 +173,37 @@ function has_excerpt( $id = 0 ) {
* @param int $post_id An optional post ID
*/
function post_class( $class = '', $post_id = null ) {
+ $post = get_post($post_id);
- $classes = 'post';
+ $classes[] = $post->post_type;
- if ( is_sticky($post_id) )
- $classes .= ' sticky';
+ if ( is_sticky($post->ID) )
+ $classes[] = 'sticky';
- if ( !empty($class) )
- $classes .= ' ' . $class;
+ // hentry for hAtom compliace
+ $classes[] = 'hentry';
- $classes = apply_filters('post_class', $classes, $class, $post_id);
+ // Categories
+ foreach ( (array) get_the_category($post->ID) as $cat ) {
+ if ( empty($cat->slug ) )
+ continue;
+ $classes[] = 'category-' . $cat->slug;
+ }
+
+ // Tags
+ foreach ( (array) get_the_tags($post->ID) as $tag ) {
+ if ( empty($tag->slug ) )
+ continue;
+ $classes[] = 'tag-' . $tag->slug;
+ }
+
+ if ( !empty($class) ) {
+ $class = preg_split('#\s+#', $class);
+ $classes = array_merge($classes, $class);
+ }
+
+ // Separates classes with a single space, collates classes for post DIV
+ $classes = join(' ', apply_filters('post_class', $classes, $class, $post_id));
echo 'class="' . $classes . '"';
}