Here a simple script that will easily implement a Facebook popup like widget to any kind of website and blogs such as blogger and wordpress.
How to implement the code to your website
2. WordPress blog – Login to your wordpress dashboard and goto Appearance > Widgets. Add a Text widget to the sidebar and add the below code in the text widget.
Understand the code and making changes
The below code has 4 variables that you can change as per your requirements-
- cookieExpire – This variable control the frequency of the popup to be shown to the users. Setting it to zero will make it popup on every page. Setting it 1 will make it appear only once in a day. Please note this value sets the number of days before the popup is shown again.
- delaySec – Time to wait a user visits your site before the popup is displayed. 1000 represents 1 sec to wait after the page is loaded.
- fbUrl – Your Facebook page URL
- popTitle – Set the Title of the popup box.
Do you like this article?