Skip to content

Instantly share code, notes, and snippets.

@danjjohnson
Last active June 9, 2017 14:04
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 danjjohnson/cc1d8eea8d9736534bbcd8ae0068644e to your computer and use it in GitHub Desktop.
Save danjjohnson/cc1d8eea8d9736534bbcd8ae0068644e to your computer and use it in GitHub Desktop.
Add 'position-filled' body class on filled single listings
add_filter( 'body_class', 'dj_add_position_filled_class' );
function dj_add_position_filled_class( $classes ) {
global $post;
if ( $post->post_type !== 'job_listing' ) {
return $classes;
}
if ( is_position_filled( $post ) ) {
$classes[] = 'position-filled';
}
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment