So I'm using this plugin called Mapplic for interactive maps on wordpress and I'm trying to hide a specific class in it for everyone except admins so first i added this function to add a class for admin function add_admin_body_class($classes) { if (current_user_can('administrator')) { $classes[] = 'is-admin'; } return $classes; } add_filter('body_class', 'add_admin_body_class'); then i added the CSS code which is .mapplic-popup-body { display: none !important; } body.is-admin .mapplic-popup-body { display: flex !important; now it's completely not showing the class for everyone including the admins could anyone help me out with this please ? so i tried changing the class in CSS from is-admin to wp-admin and it showed the class in the admin dashboard but i wanna see it in the content itself
Jese Leos
2 hours ago
Verified user
Try simple CSS. body:not(.is-admin) .mapplic-popup-body{ display:none; } This will hide the container only if admin is not logged in.