Sometimes adding a page slug to the body class makes all the difference. Styling the page through CSS makes it that much easier.
Copy this code snippet in your WordPress theme’s functions.php to add a page slug body class to your pages.
functions.php
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );
Kudos for launching the useful and even entertaining web space. I’m await to sharing info anytime that opportunity shows itself! Thanks a ton a second time for creating the site available to globe!