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' ); $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' ); $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' ); $never_expire = get_post_meta( $wpaf_coupon_id, 'coupon_details_never-expire-check', true ); $expire_time = get_post_meta( $wpaf_coupon_id, 'coupon_details_expire-time', true ); $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 ); $wpaf_image_width = get_post_meta( $wpaf_coupon_id, 'coupon_details_coupon-image-width', true ); $wpaf_image_height = get_post_meta( $wpaf_coupon_id, 'coupon_details_coupon-image-height', true ); $disable_menu = get_option( 'wpaf_disable-menu-archive-code' ); $template = new WPAF_Template_Loader(); $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; } } if ( is_array( $wpaf_coupon_image_src ) ) { $wpaf_coupon_image_src = $wpaf_coupon_image_src[0]; } else { $wpaf_coupon_image_src = ''; } 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 ) ); } $expire_date_format = gmdate( "m/d/Y", strtotime( $expire_date ) ); $wpaf_coupon_template = get_post_meta( $wpaf_coupon_id, 'coupon_details_coupon-template', true ); $wpaf_template_five_theme = get_post_meta( $wpaf_coupon_id, 'coupon_details_template-theme-color', true ); $wpaf_template_six_theme = get_post_meta( $wpaf_coupon_id, 'coupon_details_template-theme-color', true ); $wpaf_dummy_coupon_img = WPAF_Plugin::instance()->plugin_assets . 'img/coupon-200x200.png'; $wpaf_text_to_show = get_option( 'wpaf_text-to-show' ); $wpaf_custom_text = get_option( 'wpaf_custom-text' ); $dt_coupon_type_name = get_option( 'wpaf_dt-coupon-type-text' ); $dt_deal_type_name = get_option( 'wpaf_dt-deal-type-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' ); } } /* * to build the parent elment * header and in the bottom footer */ global $wpaf_parent; include('header-default.php'); ?> setCss( 'shortcode_image' ); } ?>
>
{$title}" ); else: echo wp_kses_post( "{$title}" ); endif; ?>
< class="wpaf-coupon-title"> > < class="wpaf-coupon-title"> >
= strtotime( $today ) ) { ?>
get_template_part( 'hide-coupon' ); } else { ?>
get_template_part('social-share'); } $template->get_template_part('vote-system'); endif; ?>