Hi @danstramer
Which posts are you referring to? Is it in the Profile’s Posts tab?
Regards,
Just the posts in the homepage.
They are all set to display but have different restrictions.
If the user does not have access to view the full post I would like to change the image a bit (greyscale filter or something similar). Or, add a badge to posts that he can access and view.
See here:
https://academy.dermaspark.com/
Thanks,
Dan
Hi @danstramer
Unfortunately, UM doesn’t have the ability to add a class to your custom posts grid as It is outside of UM. This requires customization on your end.
Regards,
Thanks. Can UM add a class to the body with the user’s level or role?
Hi @danstramer
It depends on your theme if it is supporting the body_class
function.
You can try this code snippet to add a body class:
add_filter( 'body_class', function( $classes ) {
$user_id = get_current_user_id();
um_fetch_user( $user_id );
$role = um_user("role");
return array_merge( $classes, array( 'um_role-'.$role ) );
} );
The above code will add the current user’s role in the body class.
e.g. um_role-administrator
Regards,
Thanks, yes. did exactly that. with a for each since the users can have more than one role.
Dan
Hi @danstramer
Thanks for letting us know. I’m marking this as resolved now.
Regards,