plugin_includes . 'functions/wpaf-coupon-thumbnail-img.php'; } global $wpaf_coupon_id, $wpaf_max_num_page; $title = get_the_title(); $link = get_post_meta($wpaf_coupon_id, 'coupon_details_link', true); $coupon_code = get_post_meta($wpaf_coupon_id, 'coupon_details_coupon-code-text', true); $coupon_thumbnail = wpaf_coupon_thumbnail_img( $wpaf_coupon_id ); $link_thumbnail = get_option('wpaf_coupon-link-featured-img'); $discount_text = get_post_meta($wpaf_coupon_id, 'coupon_details_discount-text', true); $coupon_type = get_post_meta($wpaf_coupon_id, 'coupon_details_coupon-type', true); $description = get_post_meta($wpaf_coupon_id, 'coupon_details_description', true); $show_print_links = get_option( 'wpaf_coupon-print-link' ); $deal_text = get_post_meta( $wpaf_coupon_id, 'coupon_details_deal-button-text', true ); $coupon_hover_text = get_option('wpaf_coupon-hover-text'); $deal_hover_text = get_option('wpaf_deal-hover-text'); $button_class = 'wpaf-btn-' . $wpaf_coupon_id; $no_expiry = get_option('wpaf_no-expiry-message'); $never_expire = get_post_meta($wpaf_coupon_id, 'coupon_details_never-expire-check', true); $expire_text = get_option('wpaf_expire-text'); $expired_text = get_option('wpaf_expired-text'); $hide_coupon_text = get_option('wpaf_hidden-coupon-text'); $hidden_coupon_hover_text = get_option('wpaf_hidden-coupon-hover-text'); $copy_button_text = get_option('wpaf_copy-button-text'); $coupon_title_tag = get_option('wpaf_coupon-title-tag', 'h1'); $disable_coupon_title_link = get_option('wpaf_disable-coupon-title-link'); $hide_featured_image = get_option('wpaf_hide-archive-thumbnail'); $coupon_share = get_option('wpaf_coupon-social-share'); $show_expiration = get_post_meta($wpaf_coupon_id, 'coupon_details_show-expiration', true); $today = gmdate('d-m-Y'); $expire_date = get_post_meta($wpaf_coupon_id, 'coupon_details_expire-date', true); $expireDateFormat = get_option( 'wpaf_expiry-date-format' ); $hide_coupon = get_post_meta($wpaf_coupon_id, 'coupon_details_hide-coupon', true); $wpaf_coupon_image_id = get_post_meta($wpaf_coupon_id, 'coupon_details_coupon-image-input', true); $wpaf_coupon_image_src = wp_get_attachment_image_src($wpaf_coupon_image_id, 'full'); $wpaf_show_print = get_post_meta($wpaf_coupon_id, 'coupon_details_coupon-image-print', true); $disable_menu = get_option('wpaf_disable-menu-archive-code'); $coupon_categories = get_the_terms($wpaf_coupon_id, 'wpaf_coupon_category'); $coupon_categories_class = ''; $coupon_code = ( ! empty( $coupon_code ) ? $coupon_code : __( 'COUPONCODE', 'affcoupon' ) ); $deal_text = ( ! empty( $deal_text ) ? $deal_text : __( 'Get Deal', 'affcoupon' ) ); $linkTarget = get_option("wpaf_coupon-link-target"); $target = ($linkTarget == "on") ? "_self" : "_blank" ; if ($coupon_categories && count($coupon_categories) > 0) { foreach ($coupon_categories as $category) { $coupon_categories_class .= ' ' . $category->slug; } } $template = new WPAF_Template_Loader(); if (is_array($wpaf_coupon_image_src)) { $wpaf_coupon_image_src = $wpaf_coupon_image_src[0]; } else { $wpaf_coupon_image_src = ''; } $wpaf_text_to_show = get_option('wpaf_text-to-show'); $wpaf_custom_text = get_option('wpaf_custom-text'); if ($wpaf_text_to_show == 'description') { $wpaf_custom_text = $description; } else { if (empty($wpaf_custom_text)) { $wpaf_custom_text = __("Click on 'Copy' to Copy the Coupon Code.", 'affcoupon'); } } if( ! $link && WPAF_Amp::wpaf_amp_is() ) $link = "#"; $expireDateFormatFun = wpaf_getExpireDateFormatFun( $expireDateFormat ); if ( ! empty( $expire_date ) && (string)(int)$expire_date == $expire_date ) { $expire_date = gmdate( $expireDateFormatFun, $expire_date ); } elseif ( ! empty( $expire_date ) ) { $expire_date = gmdate( $expireDateFormatFun, strtotime( $expire_date ) ); } $wpaf_coupon_template = get_post_meta($wpaf_coupon_id, 'coupon_details_coupon-template', true); /* * to build the parent elment * header and in the bottom footer */ global $wpaf_parent; include('header-grid.php'); ?>