Skip to content

Instantly share code, notes, and snippets.

@neilgee
Forked from norcross/string-body-class.php
Created August 13, 2014 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/bc08d3c03f6ff387bc65 to your computer and use it in GitHub Desktop.
Save neilgee/bc08d3c03f6ff387bc65 to your computer and use it in GitHub Desktop.
<?php
function string_body_class($classes) {
if ( isset($_GET) && isset( $_GET['class'] ) ) :
$classes[] = sanitize_html_class( $_GET['class'] );
endif;
return $classes;
}
add_filter('body_class', 'string_body_class');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment