Hide Div For Some Usergroups (for Predefined Headers) - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Hide Div For Some Usergroups (for Predefined Headers)

A

Addington

Template 3 years ago

Is there a way to hide sp-top-bar div (in the pre-defined header) for registered users but have it display for guests?

0
5 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #46709

Hello Charles Southgate

Please use this JavaScript to Template Options -> Custom Code -> Custom JavaScript

jQuery(function($) {
    if ($('.sp-sign-in').attr('href') === '#') {
        $('#sp-top-bar').css('display', 'none');
   }
});

Hopefully, it will solve your issue.

Best regards

1
A
Addington
Accepted Answer
3 years ago #46737

Great, it works!

Thanks very much.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #46768

You are welcome. Thanks for accepting the answer.

I have a humble request. It would be very kind of you if you can manage some moment to give us feedback on Joomla Extension Directory. This will inspire us to improve.

0
A
Addington
Accepted Answer
3 years ago #46776

ok

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #46862

Thank you so much for appreciating our work.

0