Changeset 8641
- Timestamp:
- 08/13/2008 09:58:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/default/archive.php
r6942 r8641 29 29 30 30 <?php while (have_posts()) : the_post(); ?> 31 <div class="post">31 <div <?php post_class() ?>> 32 32 <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> 33 33 <small><?php the_time('l, F jS, Y') ?></small> -
trunk/wp-content/themes/default/search.php
r6132 r8641 15 15 <?php while (have_posts()) : the_post(); ?> 16 16 17 <div class="post">17 <div <?php post_class() ?>> 18 18 <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> 19 19 <small><?php the_time('l, F jS, Y') ?></small> -
trunk/wp-content/themes/default/single.php
r7582 r8641 10 10 </div> 11 11 12 <div class="post"id="post-<?php the_ID(); ?>">12 <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> 13 13 <h2><?php the_title(); ?></h2> 14 14 -
trunk/wp-includes/post-template.php
r8639 r8641 174 174 */ 175 175 function post_class( $class = '', $post_id = null ) { 176 177 $classes = 'post'; 178 179 if ( is_sticky($post_id) ) 180 $classes .= ' sticky'; 181 182 if ( !empty($class) ) 183 $classes .= ' ' . $class; 184 185 $classes = apply_filters('post_class', $classes, $class, $post_id); 176 $post = get_post($post_id); 177 178 $classes[] = $post->post_type; 179 180 if ( is_sticky($post->ID) ) 181 $classes[] = 'sticky'; 182 183 // hentry for hAtom compliace 184 $classes[] = 'hentry'; 185 186 // Categories 187 foreach ( (array) get_the_category($post->ID) as $cat ) { 188 if ( empty($cat->slug ) ) 189 continue; 190 $classes[] = 'category-' . $cat->slug; 191 } 192 193 // Tags 194 foreach ( (array) get_the_tags($post->ID) as $tag ) { 195 if ( empty($tag->slug ) ) 196 continue; 197 $classes[] = 'tag-' . $tag->slug; 198 } 199 200 if ( !empty($class) ) { 201 $class = preg_split('#\s+#', $class); 202 $classes = array_merge($classes, $class); 203 } 204 205 // Separates classes with a single space, collates classes for post DIV 206 $classes = join(' ', apply_filters('post_class', $classes, $class, $post_id)); 186 207 187 208 echo 'class="' . $classes . '"';
Note: See TracChangeset
for help on using the changeset viewer.