Home › Forums › Support › Custom Body Class This topic has 2 replies, 2 voices, and was last updated 4 years, 2 months ago by Leo. Viewing 3 posts - 1 through 3 (of 3 total) Author Posts January 30, 2020 at 1:55 pm #1149801 Andy Hi all, I’m trying to add a cusotm body class to a Custom Post Type Archive using the filter below in my child themes functions file, but it’s not working: //* Add custom body class to CPT Archive add_filter( 'body_class', 'custom_body_class' ); function custom_body_class( $classes ) { if ( is_post_type_archive( 'courses' ) ) $classes[] = 'all-courses'; return $classes; } Any idea where I’m going wrong? January 30, 2020 at 1:59 pm #1149804 Andy Nevermind, I just realised the archive is plugin generated not theme generated! Doh! January 30, 2020 at 4:15 pm #1149860 LeoStaff Customer Support Glad you’ve figured out 🙂 Author Posts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In