You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,6 +11,7 @@ WordPress plugin that provides shortcode for creating popups.
10
11
Kntnt Popup is a lightweight, customizable WordPress plugin that provides an easy-to-use shortcode for creating modal popups on your website. With this plugin, you can create popups triggered by various user actions without writing any JavaScript or HTML code.
11
12
12
13
### Key Features:
14
+
13
15
- Simple shortcode implementation with extensive customization options
14
16
- Multiple trigger options: exit intent, time delay, scroll position
15
17
- Customizable animations for opening and closing
@@ -21,21 +23,45 @@ Kntnt Popup is a lightweight, customizable WordPress plugin that provides an eas
21
23
- Built with modern PHP and JavaScript practices
22
24
23
25
## Installation
26
+
24
27
1.[Download the plugin zip archive.](https://github.com/Kntnt/kntnt-popup/releases/latest/download/kntnt-popup.zip)
25
28
2. Go to WordPress admin panel → Plugins → Add New.
26
29
3. Click "Upload Plugin" and select the downloaded zip archive.
27
30
4. Activate the plugin.
28
31
29
32
## Usage
33
+
30
34
The plugin provides a shortcode `[popup]...[/popup]` where the content between the opening and closing tags will be displayed in the popup. This content is processed normally, meaning you can include text, images, HTML, and even other shortcodes inside the popup.
31
35
32
36
Basic usage:
37
+
33
38
```
34
-
[popup show-after-time="5"]
35
-
Your popup content here. Can include text, images, forms, and even other shortcodes.
36
-
[/popup]
39
+
[popup show-after-time="5"]Your popup content here. Can include text, images, forms, and even other shortcodes.[/popup]
37
40
```
38
41
42
+
In addition to the automatic triggers (time delay, scroll position, exit intent), you can also launch a popup by clicking any HTML element (like a link or button) on the page.
43
+
44
+
1.**Define the popup:** First, you must have defined the popup on the same page using the shortcode with a unique ID:
2.**Create the trigger element (link/button):** Next, add an HTML element where you want your trigger. This element must have the data attribute `data-popup-open` set to the ID of the popup you want to open.
50
+
51
+
**Example using a link:**
52
+
```html
53
+
<ahref="#"data-popup-open="my-unique-popup">Open My Popup</a>
54
+
```
55
+
56
+
**Example using a button:**
57
+
```html
58
+
<buttondata-popup-open="my-unique-popup">Open My Popup</button>
59
+
```
60
+
61
+
When a user clicks the element with `data-popup-open`, the plugin's JavaScript will automatically open the corresponding popup.
62
+
63
+
*Important:* Both the popup shortcode and the HTML element with `data-popup-open` must exist on the same page.
64
+
39
65
## Parameters
40
66
41
67
The shortcode accepts various parameters to customize the popup's behavior and appearance. Parameters can be used in three different ways:
@@ -61,6 +87,7 @@ Controls whether the popup shows when the user moves their cursor to leave the p
61
87
*Default value:*`false`
62
88
63
89
*Examples:*
90
+
64
91
*`[popup shown-on-exit-intent="true"]`: Triggers popup when user attempts to leave the page
65
92
*`[popup shown-on-exit-intent]`: Same as above since flag value is `true`
66
93
*`[popup]`: Won't trigger popup when user attempts to leave the page since default value is `false`
@@ -78,6 +105,7 @@ Controls whether the popup shows after a specified number of seconds.
78
105
*Note:* This parameter expects a numeric value without units, representing seconds.
79
106
80
107
*Examples:*
108
+
81
109
*`[popup show-after-time="5"]`: Triggers popup after 5 seconds
82
110
*`[popup show-after-time]`: Triggers popup after 30 seconds (flag value)
83
111
*`[popup]`: Won't trigger popup based on time since default value is `false`
@@ -95,6 +123,7 @@ Controls whether the popup shows after the user has scrolled a certain percentag
95
123
*Note:* This parameter expects a numeric value without units, representing percentage (0-100).
96
124
97
125
*Examples:*
126
+
98
127
*`[popup show-after-scroll="50"]`: Triggers popup after scrolling 50% of the page
99
128
*`[popup show-after-scroll]`: Triggers popup after scrolling 80% of the page (flag value)
100
129
*`[popup]`: Won't trigger popup based on scrolling since default value is `false`
@@ -112,6 +141,7 @@ Sets a custom ID attribute for the popup's wrapper div.
112
141
*Default value:* Automatically generated ID
113
142
114
143
*Examples:*
144
+
115
145
*`[popup id="newsletter-popup"]`: Sets the popup ID to "newsletter-popup"
116
146
*`[popup]`: Assigns an automatically generated ID
117
147
@@ -126,6 +156,7 @@ Adds custom CSS classes to the popup element.
126
156
*Default value:* None (no additional classes)
127
157
128
158
*Examples:*
159
+
129
160
*`[popup class="custom-theme large-popup"]`: Adds "custom-theme" and "large-popup" classes
130
161
*`[popup]`: No additional CSS classes
131
162
@@ -140,6 +171,7 @@ Adds inline CSS for the overlay element.
140
171
*Default value:* None (no inline styles)
141
172
142
173
*Examples:*
174
+
143
175
*`[popup style-overlay="backdrop-filter: blur(5px);"]`: Adds a blur effect to the overlay
144
176
*`[popup]`: No additional inline styles for the overlay
145
177
@@ -154,6 +186,7 @@ Adds inline CSS for the dialog element.
154
186
*Default value:* None (no inline styles)
155
187
156
188
*Examples:*
189
+
157
190
*`[popup style-dialog="box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);"]`: Adds shadow
158
191
*`[popup]`: No additional inline styles for the dialog
159
192
@@ -168,6 +201,7 @@ Adds inline CSS for the close button element.
168
201
*Default value:* None (no inline styles)
169
202
170
203
*Examples:*
204
+
171
205
*`[popup style-close-button="font-size: 24px; color: #ff0000;"]`: Creates a larger, red close button
172
206
*`[popup style-close-button="background-color: #333; border-radius: 50%; color: white;"]`: Creates a dark circular close button
173
207
*`[popup]`: No additional inline styles for the close button
@@ -183,10 +217,11 @@ Adds inline CSS for the popup content area.
183
217
*Default value:* None (no inline styles)
184
218
185
219
*Examples:*
220
+
186
221
*`[popup style-content="color: #333; font-size: 16px;"]`: Styles text in the popup content
187
222
*`[popup style-content="background-color: #f9f9f9; padding: 10px;"]`: Adds background and padding to content area
188
223
*`[popup]`: No additional inline styles for the content area
189
-
224
+
190
225
### Layout and Positioning Parameters
191
226
192
227
#### `position`
@@ -200,6 +235,7 @@ Determines the popup position on the screen.
200
235
*Default value:*`center`
201
236
202
237
*Examples:*
238
+
203
239
*`[popup position="top"]`: Positions the popup at the top center
204
240
*`[popup position="bottom-right"]`: Positions the popup at the bottom right
205
241
*`[popup]`: Centers the popup (default position)
@@ -217,6 +253,7 @@ Sets the desired width of the popup.
217
253
*Default value:*`clamp(300px, 90vw, 800px)`
218
254
219
255
*Examples:*
256
+
220
257
*`[popup width="500px"]`: Sets popup width to 500 pixels
221
258
*`[popup width="50%"]`: Sets popup width to 50% of viewport width
222
259
*`[popup]`: Uses the default responsive width
@@ -232,6 +269,7 @@ Sets the maximum height of the popup before scrolling is activated.
232
269
*Default value:*`95vh`
233
270
234
271
*Examples:*
272
+
235
273
*`[popup max-height="80vh"]`: Sets maximum height to 80% of viewport height
236
274
*`[popup max-height="600px"]`: Sets maximum height to 600 pixels
237
275
*`[popup]`: Uses the default maximum height (95% of viewport)
@@ -247,6 +285,7 @@ Sets the internal padding of the popup.
@@ -638,18 +705,23 @@ Now you have the necessary JavaScript file in place, and the plugin should funct
638
705
##Questions&Answers
639
706
640
707
###HowcanIgethelp?
708
+
641
709
Ifyouhavequestionsaboutthepluginandcannotfindananswerhere,startbylookingatissuesandpullrequestsonourGitHubrepository.Ifyoustillcannotfindtheanswer,feelfreetoaskintheplugin's issue tracker on GitHub.
642
710
643
711
### How can I report a bug?
712
+
644
713
If you have found a potential bug, please report it on the plugin'sissuetrackeronGitHub.
0 commit comments