• Resolved InnoRuptive

    (@innoruptive)


    Is it possible to only show a widget when a subscriber is logged in?

    The author gave this one as an example: current_user_can(‘level_10’), but this only shows the widget for admins. Is there a “level” number for just regular subscribers in which a widget will only show they are logged in?

    Thanks in advance.

    http://wordpress.org/extend/plugins/widget-logic/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Use is_user_logged_in().

    Function Reference/is user logged in

    I have tried is_user_logged_in(), doesn’t seem to work. It’s the “Welcome back” tab currently on the right side of http://mygreekstudies.com/ (it should only appear when they are logged in, it currently appears whether they are or not).

    The exact input in the widget logic area is:
    is_user_logged_in()

    That is all it needs, isn’t it?

    Thanks!

    Actually . . . nvm. I reloaded the widget page and the code wasn’t there anymore. Put it in, saved it, and it works perfectly. Bit odd that it “poofed”, but as long as it sticks now there’s no harm done :).

    Ah, I found the problem. I had a Social Login installed, and, while the widget page was open, I logged in on the actual site with Facebook (which kicked me out of the admin access); so the updates I did weren’t actually updating. Which explains the “poof”. Lol. Live and learn, right? I’ll shut up now :).

    Any ideas, how to have the opposite of is_user_logged_in()?
    Like “is_user_logged_out()…

    Thanks

    got it! it is just: !is_user_logged_in()

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Widget Logic] Show widget only when a subscriber is logged in’ is closed to new replies.