$acf_popup_use_cookies, 'acf_popup_cookie_timeout'=> $acf_popup_cookie_timeout, 'acf_popup_cookie_name' => $acf_popup_cookie_name, 'add_something_nonce' => $add_something_nonce ) ); } $popup_method = get_field('popup_method','options'); if($popup_method == 'Specific Pages'){ $popup_pages = get_field('popup_pages','options'); } $popup_animation = get_field('popup_animation', 'options'); //Popup Content Variables $popup_title = get_field('popup_title','options'); $popup_text = get_field('popup_text','options'); $popup_image = get_field('popup_image','options'); if(!empty($popup_image)){ $popup_img_tempalte = ''.esc_attr($popup_image['alt']).''; } $popup_button_text = get_field('popup_button_text','options'); $popup_link_type = get_field('popup_link_type','options'); if($popup_link_type == 'inp'){ $popup_btn_link_target = '_self'; $popup_link = get_field('page_link','options'); }elseif($popup_link_type == 'inl'){ $popup_btn_link_target = '_self'; $popup_link = get_field('popup_link','options'); }elseif($popup_link_type == 'ex'){ $popup_btn_link_target = '_blank'; $popup_link = get_field('popup_link','options'); }else{ $popup_btn_link_target = '_self'; $popup_link = get_field('popup_link','options'); } if($popup_link){ $popup_link_template = ''; } //Template Start $template = ''; //Hidden Trigger Button $template .= 'Page Popup'; $template .= '
'; //Add Title if($popup_title){ $template .= '
'.$popup_title.'
'; } //Add Text if($popup_text){ $template .= '
'.$popup_text.'
'; } //Add Image if(!empty($popup_image)){ if($popup_link){ $template .= '
'.$popup_link_template.''.$popup_img_tempalte.'
'; }else{ $template .= '
'.$popup_img_tempalte.'
'; } } //Add Button if($popup_link){ $template .= '
'.$popup_link_template.''.$popup_button_text.'
'; } //Template End $template .= '
'; if($popup_method == 'Specific Pages'){ $cur_page_id = get_the_ID(); $is_on_page = in_array($cur_page_id, $popup_pages, true); if($is_on_page){ echo($template); } }else{ echo($template); } } } add_action( 'wp_footer', 'acf_popup_content' );