Created
April 15, 2011 13:26
-
-
Save laras126/921676 to your computer and use it in GitHub Desktop.
post formats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Post formats conditional in functions.php | |
| // echo format and post classes for testing | |
| function wpfolio_post_formats() { | |
| global $post; | |
| $post_id = $post->ID; | |
| $format = get_post_format( $post_id ); | |
| if ( has_post_format( 'gallery' )) { | |
| echo '<h3>'; | |
| echo $format . '<hr />'; | |
| echo '<strong>thematic_post_class: </strong>'; | |
| echo thematic_post_class(); | |
| echo '<hr /> <strong>post_class: </strong>'; | |
| echo post_class(); | |
| echo '</h3>'; | |
| echo the_content(); | |
| } else if ( has_post_format( 'image' )) { ... | |
| } | |
| add_action('thematic_post', 'wpfolio_post_formats'); | |
| ?> | |
| Sample .format-$format CSS classes: | |
| .format-video { | |
| background-color:blue; | |
| } | |
| .format-image { | |
| background-color:blue; | |
| } | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment