Hi @tagtag,
We changed the prefix of the folder taxonomies from wicked_ to wf_ to correct a bug with the taxonomy names being too long in certain cases. So, to get the previous code to work, you just need to change the prefix to wf_.
Here is the updated code:
// Add body class filter
add_filter( 'body_class', 'custom_body_classes' );
function custom_body_classes( $classes ) {
// Folder taxonomies are named in the format 'wicked_{$post_type}_folders'
$taxonomy = 'wf_' . get_post_type() . '_folders';
// Get slugs of folders that the current post belongs to
$folders = wp_get_object_terms( get_the_ID(), $taxonomy, array( 'fields' => 'slugs' ) );
// Merge the folder slugs into the body classes array
$classes = array_merge( $classes, $folders );
return $classes;
}
Hope this helps! Let me know if you still have trouble.
Thread Starter
tagtag
(@tagtag)
Thank you for your quick feedback!
I’m sorry, but it doesn’t work either. Isn’t it possible to force this class addition on the body?
Also, the latest version of this plugin overwrites some other rules to add more class to the body….
Do you have any idea?
Thanks
Thread Starter
tagtag
(@tagtag)
Okay, it was my fault! I found my problem 😉
It now works well with this new taxonomy!!
Thanks again
Great, glad to hear it worked!