I want to build an alert for users who visit my WordPress blog. Is there a conditional function like is_home()
to detect if someone visits the blog the first time? I want to send the alert to every new user no matter on which site he entered.
Leave a Reply
You must be logged in to post a comment.
No, there’s nothing in the core like that.
You can set a cookie and do it simply enough (warning: untested code follows).
Just make sure you have output buffering turned on or use that before anything gets sent to the screen to make sure the cookie gets set.
Modified a bit from chrisguitarguy. Place in your functions.php file, and use the conditional in theme templates, etc. via the hook