{"id":21909,"date":"2018-03-26T16:10:55","date_gmt":"2018-03-26T10:40:55","guid":{"rendered":"http:\/\/convertplug.com\/plus\/?post_type=docs&#038;p=21909"},"modified":"2018-03-26T16:11:32","modified_gmt":"2018-03-26T10:41:32","slug":"display-a-module-only-when-another-convert-plus-module-is-seen","status":"publish","type":"docs","link":"https:\/\/convertplug.com\/plus\/docs\/display-a-module-only-when-another-convert-plus-module-is-seen\/","title":{"rendered":"How to Display a Module only when a specific Convert Plus Module is seen?"},"content":{"rendered":"<p>Have you ever thought of displaying a Convert Plus module only after a user has successfully submitted another module?<\/p>\n<p>You can do that using the target page settings.<\/p>\n<p>We do not have a default option to display a module only if some specific cookies set. But, you can achieve this using target page filter &#8216;<strong>cp_target_page_settings<\/strong>&#8216; which handles the visibility of a module and cookies of the module which is set after successful submission of the form.<\/p>\n<p>Here is an article we have for <a href=\"http:\/\/convertplug.com\/plus\/docs\/target-page-settings-filter-convertplus\/\" target=\"_blank\" rel=\"noopener\">target page settings in Convert Plus<\/a>.<\/p>\n<p>You can add this code in your theme&#8217;s function.php file.<\/p>\n<p>Here is a reference for the code that can be added.<\/p>\n<pre>function your_callback_function( $display, $style_id ) {\r\n$cookie_name = 'style_id2'; \/\/change the cookiename as per your style id.\r\n\r\n\/\/ Replace style id with your style ID\r\nif( $style_id == 'cp_id_d3a5b' ) {\r\n\r\n\/\/ your custom logic\r\n$display = false;\r\n\r\nif(isset($_COOKIE[$cookie_name])){\r\n$display = true;\r\n}\r\n   \r\n}\r\n\r\nreturn $display;\r\n}\r\nadd_filter( 'cp_target_page_settings', 'your_callback_function', 10, 3 );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever thought of displaying a Convert Plus module only after a user has successfully submitted another module? You can do that using the target page settings. We do not have a default option to display a module only if some specific cookies set. But, you can achieve this using target page filter &#8216;cp_target_page_settings&#8216; [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"template":"","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"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":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"docs_category":[24],"docs_tag":[],"class_list":["post-21909","docs","type-docs","status-publish","hentry","docs_category-triggers"],"_links":{"self":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/21909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/users\/12"}],"version-history":[{"count":0,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs\/21909\/revisions"}],"wp:attachment":[{"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/media?parent=21909"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_category?post=21909"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/convertplug.com\/plus\/wp-json\/wp\/v2\/docs_tag?post=21909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}