{"id":44063,"date":"2026-05-21T14:46:42","date_gmt":"2026-05-21T14:46:42","guid":{"rendered":"https:\/\/getshortcodes.com\/?post_type=demo-modal&#038;p=44063"},"modified":"2026-05-22T09:00:13","modified_gmt":"2026-05-22T09:00:13","slug":"lightbox","status":"publish","type":"demo-modal","link":"https:\/\/getshortcodes.com\/demo-modal\/lightbox\/","title":{"rendered":"Lightbox"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Lightbox with an Image<\/h2>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"https:\/\/placehold.co\/600x400?text=Example+Image\" data-mfp-type=\"image\" data-mobile=\"yes\">\n<a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open lightbox with an image <\/span><\/a>\n<\/span>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"image\" src=\"https:\/\/placehold.co\/600x400?text=Example+Image\"]\n&#091;su_button] Open lightbox with an image &#091;\/su_button]\n&#091;\/su_lightbox]<\/code><\/pre>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Lightbox with a Webpage (Iframe)<\/h2>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"https:\/\/example.com\/\" data-mfp-type=\"iframe\" data-mobile=\"yes\">\n<a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open lightbox with example.com <\/span><\/a>\n<\/span>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"image\" src=\"https:\/\/example.com\/\" type=\"iframe\"]\n&#091;su_button] Open lightbox with example.com &#091;\/su_button]\n&#091;\/su_lightbox]<\/code><\/pre>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Lightbox with a YouTube Video<\/h2>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"https:\/\/www.youtube.com\/watch?v=bcQh3b0LJyk\" data-mfp-type=\"iframe\" data-mobile=\"yes\">\n<a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open lightbox with a YouTube video <\/span><\/a>\n<\/span>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"iframe\" src=\"https:\/\/www.youtube.com\/watch?v=bcQh3b0LJyk\"]\n&#091;su_button] Open lightbox with a YouTube video &#091;\/su_button]\n&#091;\/su_lightbox]<\/code><\/pre>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Lightbox with Custom Inline Content<\/h2>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"#my-custom-popup\" data-mfp-type=\"inline\" data-mobile=\"yes\">\n<a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  Open lightbox with custom HTML content and shortcodes <\/span><\/a>\n<\/span>\n<div class=\"su-lightbox-content su-u-trim \" id=\"my-custom-popup\" style=\"display:none;width:auto;min-width:none;max-width:600px;margin-top:40px;margin-bottom:40px;padding:40px;background:#FFFFFF;color:#333333;box-shadow:0px 0px 15px #333333;text-align:center\">\n<h3>Custom HTML content<\/h3>\n<p>Any <strong>HTML<\/strong> <em>tags<\/em> can be used here. Other shortcodes are also <span class=\"su-highlight\" style=\"background:#ddff99;color:#000000\">&nbsp;allowed&nbsp;<\/span>.<\/p>\n<\/div>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"inline\" src=\"#my-custom-popup\"]\n&#091;su_button] Open lightbox with custom HTML content and shortcodes &#091;\/su_button]\n&#091;\/su_lightbox]\n\n&#091;su_lightbox_content id=\"my-custom-popup\"]\n\n&lt;h3&gt;Custom HTML content&lt;\/h3&gt;\n\nAny &lt;strong&gt;HTML&lt;\/strong&gt; &lt;em&gt;tags&lt;\/em&gt; can be used here. Other shortcodes are also &#091;su_highlight]allowed&#091;\/su_highlight].\n\n&#091;\/su_lightbox_content]<\/code><\/pre>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Custom Trigger Element<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can wrap any element with the lightbox shortcode to make it open a lightbox<\/p>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"https:\/\/www.youtube.com\/watch?v=bcQh3b0LJyk\" data-mfp-type=\"iframe\" data-mobile=\"yes\">\n<span class=\"su-highlight\" style=\"background:#ddff99;color:#000000\">&nbsp; WATCH VIDEO &nbsp;<\/span>\n<\/span>\n<span class=\"su-lightbox\" data-mfp-src=\"https:\/\/placehold.co\/600x400?text=Example+Image\" data-mfp-type=\"image\" data-mobile=\"yes\">\n<img decoding=\"async\" src=\"https:\/\/placehold.co\/400x100?text=Open+Lightbox\" alt=\"Open Lightbox\" \/><br \/>\n<\/span>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"iframe\" src=\"https:\/\/www.youtube.com\/watch?v=bcQh3b0LJyk\"]\n&#091;su_highlight] WATCH VIDEO &#091;\/su_highlight]\n&#091;\/su_lightbox]\n\n&#091;su_lightbox type=\"image\" src=\"https:\/\/placehold.co\/600x400?text=Example+Image\"]\n&lt;img src=\"https:\/\/placehold.co\/400x100?text=Open+Lightbox\" alt=\"Open Lightbox\" \/&gt;\n&#091;\/su_lightbox]<\/code><\/pre>\n<\/details>\n\n\n\n<h2 class=\"wp-block-heading\">Using with Forms<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your form has shortcode, you can show that shortcode inside of a lightbox. See the example below:<\/p>\n\n\n<span class=\"su-lightbox\" data-mfp-src=\"#my-contact-form-lightbox\" data-mfp-type=\"inline\" data-mobile=\"yes\">\n<a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\">  CONTACT US <\/span><\/a>\n<\/span>\n<div class=\"su-lightbox-content su-u-trim \" id=\"my-contact-form-lightbox\" style=\"display:none;width:auto;min-width:none;max-width:600px;margin-top:40px;margin-bottom:40px;padding:40px;background:#FFFFFF;color:#333333;box-shadow:0px 0px 15px #333333;text-align:center\">\n[YOUR_CONTACT_FORM_SHORTCODE]\n<\/div>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Shortcode<\/summary>\n<pre class=\"wp-block-code\"><code>&#091;su_lightbox type=\"inline\" src=\"#my-contact-form-lightbox\"]\n&#091;su_button] CONTACT US &#091;\/su_button]\n&#091;\/su_lightbox]\n\n&#091;su_lightbox_content id=\"my-contact-form-lightbox\"]\n&#091;YOUR_CONTACT_FORM_SHORTCODE]\n&#091;\/su_lightbox_content]<\/code><\/pre>\n<\/details>\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"class_list":["post-44063","demo-modal","type-demo-modal","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/demo-modal\/44063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/demo-modal"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/demo-modal"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=44063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}