Add Custom Body Class to WP Thesis


/ Published in: PHP
Save to your folder(s)

Function to add custom body class in th Thesis theme for WordPress...Thanks to @girliegeek!


Copy this code and paste it in your HTML
  1. // Add my-custom-class to body tag
  2.  
  3. function custom_body_class($classes) {
  4. $classes[] = 'my-custom-class';
  5. return $classes;
  6. }
  7. add_filter('thesis_body_classes', 'custom_body_class');
  8.  
  9. // To single pages only
  10.  
  11. function custom_body_class($classes) {
  12. if (is_single()) {
  13. $classes[] = 'my-custom-class';
  14. return $classes;
  15. }
  16. }
  17. add_filter('thesis_body_classes', 'custom_body_class');

URL: http://codesnippets.joyent.com/posts/show/2304

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.