Example #1
0
            echo $code->post_content;
            ?>
</p>
															<?php 
            $has_ratings = coupon_get_option('code_dailly_ratings');
            if (in_array('code', $has_ratings)) {
                echo coupon_get_ratings($code->ID);
            }
            ?>
														</div>
														<div class="item-meta">
															<ul class="list-inline list-unstyled">
																<li>
																	<a href="javascript:;">
																		<span class="fa fa-clock-o"></span><?php 
            echo coupon_remaining_time($expire_timestamp);
            ?>
</a>
																</li>
																<li>
																	<a href="<?php 
            echo esc_url(coupon_get_label_link($shop_id, $code->ID));
            ?>
">
																		<span class="fa fa-tag"></span><?php 
            echo coupon_label($code->ID);
            ?>
																	</a>
																</li>
																<li class="pull-right">
																	<a href="<?php 
Example #2
0
    function coupon_home_list($codes)
    {
        if (!empty($codes)) {
            $has_ratings = coupon_get_option('code_dailly_ratings');
            $counter = 0;
            foreach ($codes as $code) {
                $content = $code->post_content;
                $length = strlen($content);
                $content = strip_tags($content);
                $content = mb_substr($content, 0, 58);
                $content .= $length > 58 ? '...' : '';
                $code_meta = get_post_meta($code->ID);
                $code_type = coupon_get_smeta('code_type', $code_meta, '2');
                $code_text = coupon_get_smeta('code_text', $code_meta, '');
                $expire_timestamp = coupon_get_smeta('code_expire', $code_meta, time());
                $shop_id = coupon_get_smeta('code_shop_id', $code_meta, '');
                $code_api = coupon_get_smeta('code_api', $code_meta, '');
                $code_couponcode = coupon_get_smeta('code_couponcode', $code_meta, '');
                $coupon_label = coupon_get_smeta('coupon_label', $code_meta, '');
                if ($counter == 4) {
                    $counter = 0;
                    ?>
			</div>
			</div>
			<div class="featured-container col-md-12">
			<div class="row">
			<?php 
                }
                $counter++;
                ?>
				<!-- item-1 -->
				<div class="featured-item-container col-md-3">
					<div class="featured-item">
						<?php 
                echo coupon_code_type($code_type);
                ?>
						<?php 
                if (has_post_thumbnail($shop_id)) {
                    ?>
							<div class="logotype">
								<div class="logotype-image">
									<?php 
                    echo get_the_post_thumbnail($shop_id, 'shop_logo');
                    ?>
								</div>						
							</div>
							<?php 
                }
                ?>
							<div class="featured-item-content">
								<a href="<?php 
                echo get_permalink($code->ID);
                ?>
"><h4><?php 
                echo $code->post_title;
                ?>
</h4></a>
								<p><?php 
                echo apply_filters('the_content', $content);
                ?>
</p>
							<?php 
                if (in_array('code', $has_ratings)) {
                    echo coupon_get_ratings($code->ID);
                }
                ?>
						</div>
						<div class="item-meta">
							<ul class="list-inline list-unstyled">
								<li>
									<a href="javascript:;">
										<span class="fa fa-clock-o"></span><?php 
                echo coupon_remaining_time($expire_timestamp);
                ?>
									</a>
								</li>
								<?php 
                $label = coupon_label($code->ID);
                if (!empty($label)) {
                    ?>
									<li>
										<a href="<?php 
                    echo esc_url(coupon_get_label_link($shop_id, $code->ID));
                    ?>
">
											<span class="fa fa-tag"></span><?php 
                    echo $label;
                    ?>
										</a>
									</li>
								<?php 
                }
                ?>
								<li class="pull-right">
									<a href="<?php 
                echo esc_url(get_permalink($shop_id));
                ?>
">
										<span class="fa fa-plus-square"></span>
									</a>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<!-- .item-1 -->
			<?php 
            }
        }
    }