Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

how to do display: block after user login

WordPress has a class when the user has been log in to the site.

.logged-in

You can use that to check with javascript and show the pop up.

This can be hidden if the user has not been logged in.

And if this you want to show only one time of x number of times you can do it with cookies (among other options)

$(document).ready(function() {
    if ($.cookie('cookiepopupcheck')){ 
        $('#welcome').hide();
    }else {
        $("#close-welcome").click(function() {
            $(".welcome").fadeOut(3000);
            $.cookie('cookiepopupcheck', true);    
        });
    }
});

File can be included with Enqueue
And the this is the file github project

Related Posts:

  1. Check if user is logged in using JQuery
  2. jQuery AJAX form validation
  3. Removing labels and tag on WordPress’s default login form
  4. Using wp_ajax and wp_ajax_nopriv hooks
  5. Making the wordpress login form a jQuery dropdown
  6. Exclude some scripts from removing unique scripts from head function
  7. Trouble with WordPress Ajax Login System – 302
  8. SSL issues with WordPress site
  9. How to fix my old theme so it loads jQuery properly
  10. timeouts (ERR_CONNECTION_RESET) on seemingly random files after upgrading to HTTPS
  11. Adding JavaScript file in Admin Panel
  12. Can user meta be shown or hidden depending on user logged in status?
  13. Which hook to use when adding ajax to viewer-facing side?
  14. Query String Link With Anchor Tag Not Working on Same Page
  15. animate.style on wp-login.php
  16. Add JQuery As Code Snippet
  17. Change button text with user name using jQuery after user login
  18. Add a jQuery snippet for sepcific user role
  19. Move jQuery on *top* of footer
  20. $_POST empty in using new php file added to theme
  21. wp_signon not working fine and 302 moved temporarily?
  22. Hook with jquery script is not working in wp-admin [closed]
  23. JavaScript sleep/wait before continuing [duplicate]
  24. JSON parsing error syntax error unexpected end of input
  25. Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
  26. How do I link a JavaScript file to a HTML file?
  27. What does [object Object] mean? (JavaScript)
  28. jQuery $(this) keyword
  29. Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
  30. How to set time delay in javascript
  31. Disable button in jQuery
  32. jQuery $(this) keyword
  33. JavaScript error (Uncaught SyntaxError: Unexpected end of input)
  34. Disable button in jQuery
  35. JavaScript error (Uncaught SyntaxError: Unexpected end of input)
  36. How to wait 5 seconds with jQuery?
  37. Submit a form using jQuery
  38. How to Handle Button Click Events in jQuery?
  39. How to enable CORS in flask
  40. How can I get the ID of an element using jQuery?
  41. jQuery equivalent of JavaScript’s addEventListener method
  42. Should I use .done() and .fail() for new jQuery AJAX code instead of success and error
  43. Pass request headers in a jQuery AJAX GET call
  44. $.ajax – dataType
  45. what does jQuery data() function do
  46. How to show loading spinner in jQuery?
  47. How can I get the ID of an element using jQuery?
  48. What is content-type and datatype in an AJAX request?
  49. jQuery Selector: Id Ends With?
  50. speedtest.net api
  51. jQuery dialog popup
  52. data.map is not a function
  53. How do you select a particular option in a SELECT element in jQuery?
  54. Set select option ‘selected’, by value
  55. Change Placeholder Text using jQuery
  56. Adding placeholder attribute using Jquery
  57. jQuery Ajax error handling, show custom exception messages
  58. How to send multiple data fields via Ajax?
  59. Adding an onclick function to go to url in JavaScript?
  60. Checking a Url in Jquery/Javascript
  61. Jquery change background color
  62. My javascript is returning this error: $.ajax is not a function
  63. Best way to store a key=>value array in JavaScript?
  64. jQuery if div contains this text, replace that part of the text
  65. Javascript Runtime error: $ is undefined
  66. Bootstrap – Uncaught TypeError: Cannot read property ‘fn’ of undefined
  67. jQuery set checkbox checked
  68. JavaScript: filter() for Objects
  69. What is different between $(document).on() and $(element).on()
  70. JavaScript runtime error: ‘$’ is undefined
  71. When and why to ‘return false’ in JavaScript?
  72. How to use jQuery qTip?
  73. Installing jQuery?
  74. Email validation using jQuery
  75. Order of $(document).load() and $(document).ready() when deferring loading js
  76. How to write jquery If else statement?
  77. Wildcards in jQuery selectors
  78. wait() or sleep() function in jquery?
  79. Download File Using jQuery
  80. jQuery: How can I create a simple overlay?
  81. JavaScript Loading Screen while page loads
  82. Jquery Ajax Posting JSON to webservice
  83. Force a default browser on my android phone using a simple html shortcut page
  84. Invalid or unexpected token on a very simple function
  85. Ajax TypeError: $.POST is not a function
  86. How can I display a tooltip message on hover using jQuery?
  87. Is jQuery $.browser Deprecated?
  88. Set selected option of select box
  89. jQuery date formatting
  90. Copy to clipboard using jquery?
  91. TypeError: $.ajax(…) is not a function?
  92. Format date to MM/dd/yyyy in JavaScript
  93. jquery loop on Json data using $.each
  94. How is JavaScript .on() method defined?
  95. how to use substr() function in jquery?
  96. How to change a text with jQuery
  97. XML Parsing Error: not well-formed in FireFox but good in Chrome
  98. Click button copy to clipboard
  99. jQuery animate scroll
  100. Rotate image with javascript
Categories jQuery Tags hooks, jquery, login
Is the ‘parse_query’ filter still valid to change filtered content on admin list view?
How to override post-new.php with custom template

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress