/** * User comment list custom callback function. * * @since 0.1.0 */ function kt_user_reviews_list_callback($comment, $args, $depth) { $post_id = $comment->comment_post_ID; //$user_id = $args->user_id; $post_obj = get_post($post_id); $permalink = get_permalink($post_id); $post_thumbnail = get_the_post_thumbnail($post_id, 'medium'); if ($post_obj->post_type == 'shop') { $business_category = get_the_terms($post_id, 'shop_category'); } else { if ($post_obj->post_type == 'tour') { $business_category = get_the_terms($post_id, 'tour_category'); } } $location_category = get_the_terms($post_id, 'location_category'); $kt_shop_ppp = get_post_meta($post_id, '_kt_shop_ppp', TRUE); $kt_shop_rating = get_post_meta($post_id, '_kt_rating', TRUE); ?> <li <?php hybrid_attr('comment'); ?> > <article <?php hybrid_attr('list'); ?> > <section class="info-container clear-fix"> <div class="list-thumbnail"> <a href=" <?php echo $permalink; ?> "> <figure> <?php echo $post_thumbnail; ?> </figure> </a> </div><!-- .list-thumbnail --> <div class="list-info"> <header class="list-header"> <?php kt_title(FALSE, '<h5 class="list-title"><a href="' . $permalink . '">', '</a></h5>', $post_id); ?> </header> <ul> <?php if (!empty($kt_shop_ppp)) { ?> <li> <?php echo $kt_shop_ppp; ?> RMB </li> <?php } ?> </ul> <ul> <?php foreach ($business_category as $item) { ?> <li> <?php echo $item->name; ?> </li> <?php } ?> </ul> <?php if (!empty($location_category)) { ?> <ul> <?php foreach ($location_category as $item) { ?> <li> <?php echo $item->name; ?> </li> <?php } ?> </ul> <?php } ?> </div><!-- .list-info --> </section><!-- .info-container --> <div <?php hybrid_attr('comment-content'); ?> > <section> <span> <time <?php hybrid_attr('comment-published'); ?> ><?php printf(__('%s ago', 'stargazer'), human_time_diff(get_comment_time('U'), current_time('timestamp'))); ?> </time> </span> <span> <?php if ($comment_rating = get_comment_meta(get_comment_ID(), '_kt_rating', true)) { $comment_rating = '<div class="comment-star-rating"><span>Rating: </span><span class="star-rating"><i class="star-' . $comment_rating * 10 . '"></i></span></div>'; echo $comment_rating; } ?> </span> </section> <?php comment_text(); ?> <footer> <?php if (!empty($comment->user_id) && $comment->user_id == get_current_user_id()) { ?> <form method="post" action="<?php echo get_page_link(); ?> "> <?php wp_nonce_field('kt_update_reviews', 'kt_nonce_field'); ?> <button type="submit" class="delete" name="comment" value="<?php echo $comment->comment_ID; ?> "><span class="ui-icon ui-icon-trash"></span></button> </form> <?php } ?> </footer> </div><!-- .comment-content --> </article> <?php }
<?php } ?> <?php } else { ?> <a href="<?php echo wp_login_url(get_permalink()); ?> "><button></button></a> <?php } ?> </div> <?php kt_title(FALSE, '<h2 class="shop-title">', '</h2>'); ?> </header><!-- .entry-header --> <section <?php hybrid_attr('entry-content'); ?> > <?php if (!empty($kt_shop_event)) { ?> <div class="extra-box"> <h3 class="widget-title font-headlines">이벤트</h3> <div>
/** * Show related shop custom post. * * @version 0.1.0 * @since 0.1.0 */ function kt_related_items($post, $taxonomy, $term) { if (empty($post)) { return; } $post_type = get_post_type($post); $args = array('post_type' => $post_type, 'post__not_in' => array($post->ID), 'tax_query' => array(array('taxonomy' => $taxonomy, 'field' => 'term_id', 'terms' => $term)), 'posts_per_page' => 6, 'orderby' => 'rand'); $kt_query = new WP_Query($args); if ($kt_query->have_posts()) { while ($kt_query->have_posts()) { $kt_query->the_post(); ?> <li> <a href="<?php the_permalink(); ?> "> <figure> <?php the_post_thumbnail('medium'); ?> <figcaption> <?php kt_title(); ?> </figcaption> </figure> </a> </li> <?php } } else { $term_obj = get_term($term); echo '<p>죄송합니다, 다른 ' . $term_obj->name . ' 없습니다</p>'; } wp_reset_postdata(); }
esc_url(the_permalink()); ?> " > <?php the_post_thumbnail('medium'); ?> </a> <?php } ?> </div><!-- .list-thumbnail --> <div class="list-info"> <header class="list-header"> <?php kt_title(FALSE, sprintf('<h5 class="list-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h5>'); ?> </header> <?php $post_id = get_the_ID(); // Shop meta data $kt_shop_meta = get_post_meta($post_id, '_kt_shop_data', TRUE); $kt_shop_rating = get_post_meta($post_id, '_kt_rating', TRUE); $kt_rating = !empty($kt_shop_rating) ? $kt_shop_rating : '0'; $kt_shop_max_dc = get_post_meta($post_id, '_kt_shop_max_dc', TRUE); $kt_shop_event = get_post_meta($post_id, '_kt_shop_event', TRUE); $shop_category = get_the_terms($post_id, 'shop_category'); $location_category = get_the_terms($post_id, 'location_category'); ?>