Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide welcome widget if user is logged


  • grosbouff
    Participant

    @grosbouff

    Hi, I’ve seen that the Welcome Widget was hiding the “join” button if the user is logged.

    That’s nice…

    But I would like to hide it completely (not just the button) if the user is logged.

    I searched a little and found this :

    //removes welcome widget if user is logged

    function unregister_widgets() {

    if (is_user_logged_in())

    unregister_sidebar_widget(‘BP_Core_Welcome_Widget’);

    }

    add_action( ‘widgets_init’, ‘unregister_widgets’);

    The problem it’s that I can’t make it work. It is still there.

    I also did try with

    unregister_sidebar_widget(‘Welcome’);

    but this don’t work either.

    How can I do ?

    My solution actually is to hide it with css but I don’t like that…

    (or maybe this feature should be added in the widget !)

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide welcome widget if user is logged’ is closed to new replies.
Skip to toolbar