Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 16h 18m 02s
Claim 50% off
Solved Templates

Hide div for some usergroups (for predefined headers)

Asked by Addington 4 years ago Last activity 4 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?

Accepted answer

Marked as the solution
Ofi Khan Staff

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

4 more replies

Addington Asked this

Great, it works!

Thanks very much.

Ofi Khan Staff

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.

Addington Asked this

ok

Ofi Khan Staff

Thank you so much for appreciating our work.

Log in to reply.