Title: Function for visitors
Last modified: July 24, 2020

---

# Function for visitors

 *  Resolved [Rahim](https://wordpress.org/support/users/rahimvaziri/)
 * (@rahimvaziri)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/function-for-visitors/)
 * HI Schea,
    Hope you are fine. 🙂
 * Fist of all thank you so much for your great plugin.
 * I have added an snippet via your plugin:
 *     ```
       add_action( 'wp_head', function () { ?>
       <script>
   
       jQuery(document).ready(function(){
       jQuery('.cb.chp.db').addClass('digits-login-modal').attr('type',1);
       });
   
       </script>
       <?php } );
       ```
   
 * Is there any chance to have this only for logged out users (visitors) and not
   logged in users?
 * Kind Regards,
    Rahim
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffunction-for-visitors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/function-for-visitors/#post-13165608)
 * Definitely! Here’s how you can do it:
 *     ```
       add_action( 'wp_head', function () {
       	if ( is_user_logged_in() ) {
       		return;
       	}
       ?>
       <script>
   
       jQuery(document).ready(function(){
       jQuery('.cb.chp.db').addClass('digits-login-modal').attr('type',1);
       });
   
       </script>
       <?php } );
       ```
   
 *  Thread Starter [Rahim](https://wordpress.org/support/users/rahimvaziri/)
 * (@rahimvaziri)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/function-for-visitors/#post-13165632)
 * Thank you Schea,
    It worked.
 * I think it’s not a bad idea to add this feature in the core of the plugin.
    So
   users can manage the snippets much more than before.
 * Kind regards. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Function for visitors’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rahim](https://wordpress.org/support/users/rahimvaziri/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/function-for-visitors/#post-13165632)
 * Status: resolved