{"id":2695,"date":"2017-12-28T05:15:48","date_gmt":"2017-12-28T05:15:48","guid":{"rendered":"https:\/\/docs.contentviewspro.com\/?p=2695"},"modified":"2023-07-24T10:23:41","modified_gmt":"2023-07-24T10:23:41","password":"","slug":"use-third-party-lightbox","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/use-third-party-lightbox\/","title":{"rendered":"Use a third-party lightbox"},"content":{"rendered":"<p>Content Views Pro helps you to show posts in a lightbox on clicking the post thumbnail easily (<a href=\"https:\/\/contentviewspro.com\/demo\/open-link-options\/\" target=\"_blank\" rel=\"noopener noreferrer\">click to see sample<\/a>).<\/p>\n<p>If you want to use a third-party lightbox, please:<\/p>\n<ul>\n<li>install a lightbox plugin you want<\/li>\n<li>disable the lightbox in the View (not select the lightbox option in Display Settings &gt;&gt; Others &gt;&gt; Open Item In)<\/li>\n<\/ul>\n<p>Some lightbox plugins will work with images in our grid\/list automatically.<\/p>\n<p>Some other lightbox plugins need manual configuration. The most popular configuration is adding HTML attribute to images. If so, please add this code to file <strong>functions.php<\/strong> in the theme&#8217;s folder:<\/p>\n<pre style=\"font-size: 13px;\">\/\/ Content Views Pro - Use third party lightbox\nadd_filter( 'pt_cv_field_href_attrs', 'cvp_theme_use_another_lightbox', 100, 3 );\nfunction cvp_theme_use_another_lightbox( $custom_attr, $open_in, $oargs = array() ) {\n\n\t\/** For example:\n\t  $custom_attr[] = 'rel=\"lightbox\"';\n\t  $custom_attr[] = 'data-rel=\"iLightbox[gallery-1]\"';\n\t *\/\n\n\t$custom_attr[] = 'LIGHTBOX_HTML_ATTRIBUTE_HERE';\n\n\treturn $custom_attr;\n}\n<\/pre>\n<p>The <code>LIGHTBOX_HTML_ATTRIBUTE_HERE<\/code> depends on the third-party lightbox you use.<\/p>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content Views Pro helps you to show posts in a lightbox on clicking the post thumbnail easily (click to see sample). If you want to use a third-party lightbox, please: install a lightbox plugin you want disable the lightbox in the View (not select the lightbox option in Display Settings &gt;&gt; Others &gt;&gt; Open Item &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/use-third-party-lightbox\/\"> <span class=\"screen-reader-text\">Use a third-party lightbox<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[14],"doc_tag":[21],"class_list":["post-2695","docs","type-docs","status-publish","hentry","doc_category-plugins","doc_tag-custom-code"],"year_month":"2026-09","word_count":169,"total_views":"3","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"CVP","author_nicename":"cvp","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/cvp\/"},"doc_category_info":[{"term_name":"Work with Themes &amp; Plugins","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/plugins\/"}],"doc_tag_info":[{"term_name":"custom PHP code","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-code\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=2695"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2695\/revisions"}],"predecessor-version":[{"id":4877,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2695\/revisions\/4877"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2695"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2695"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}