Support » Plugin: Easy Notification Bar » Notification to prompt user log in

  • Resolved wwwireforks

    (@wwwireforks)


    Hi, thanks for this neat plugin!
    I want to use this notice to ask users to log in or register an account on my WooCommerce site. Is it possible to therefore show the notice *only* for logged out users and hide/disable it for logged in users?
    Thank you 🙂

Viewing 1 replies (of 1 total)
  • Plugin Author wpexplorer

    (@wpexplorer)

    @wwwireforks Hi, sorry for the delay. Unfortunately there is no setting you can use but it’s easy with a little code. And there are 2 methods. You can use PHP to hide it or CSS.

    PHP would look like this:

    add_filter( 'easy_notification_bar_is_enabled', function( $check ) {
    	if ( is_user_logged_in() ) {
    		return false;
    	}
    	return $check;
    } );

    And the code would be added in a child theme functions.php file or using the popular Code Snippets plugin.

    CSS would look like this:

    body.logged-in .easy-notification-bar { display: none !important; }

    And you can add this in your child theme style.css file or at Appearance > Customize > Additional CSS.

    – AJ

    • This reply was modified 8 months, 2 weeks ago by wpexplorer.
Viewing 1 replies (of 1 total)
  • The topic ‘Notification to prompt user log in’ is closed to new replies.