Last active
August 29, 2015 14:18
-
-
Save frankschrijvers/955a4d069fb45f1ed661 to your computer and use it in GitHub Desktop.
Add custom class to post
This file contains 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
// Add custom post class to posts | |
add_filter('post_class', 'wpstudio_custom_post_class'); | |
function wpstudio_custom_post_class($classes) { | |
$new_class = 'brick'; | |
$classes[] = esc_attr(sanitize_html_class($new_class)); | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment