Last active
November 9, 2015 16:55
-
-
Save jpmarchand/73ad786fa409c25d3351 to your computer and use it in GitHub Desktop.
Remove .page class from a page template. Source: https://wordpress.org/support/topic/how-to-delete-page-class-from-body-on-one-page-template?replies=5#post-2395764
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 | |
| //* Remove .page class from page template file portfolio.php | |
| add_filter('body_class', 'prefix_remove_body_class', 20, 2); | |
| function prefix_remove_body_class($wp_classes) { | |
| if (is_page_template('portfolio.php')): | |
| foreach ($wp_classes as $key => $value) { | |
| if ($value == 'page') unset($wp_classes[$key]); | |
| } | |
| endif; | |
| return $wp_classes; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment