Here is what I have so far in my functions.php.
add_filter('body_class','cp_new_body_classes');
function cp_new_body_classes($classes) {
if( !is_page_template() ) {
$classes[] = 'reg-page';
return $classes;
}
}
I’m trying to append the class of reg-page
to pages that are not page templates. For the pages that are page templates, I just want to leave the classes as they are. When trying the code above, the class of reg-page
gets added like I want to pages which are not page templates but the other pages (which are page templates) get left with no classes at all. How can I fix this code?