$google_map = get_post_meta($eventId, "google_map", true); // Google map $eventCatList = get_the_terms($eventId, 'event_cat'); // Categories ?> <div id="classified"> <div class="form-group"> <h1> <?php the_title(); ?> </h1> <span class="review"> <?php if (function_exists("pvc_get_post_views")) { echo pvc_get_post_views($eventId); } ?> </span> <span class="glyphicon glyphicon-eye-open"></span> </div> <div class="row upload"> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-5"> <div class="image mr-classified-ad-thumb"> <?php if (has_post_thumbnail()) { the_post_thumbnail('full'); } else { echo '<img alt="" src="' . get_template_directory_uri() . '/images/empty-pic.png">'; } ?> </div> </div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"> <div id="thepostid-<?php echo get_the_ID(); ?> " class="bg-lightblue form-group col-xs-12 col-sm-12 col-md-12 col-lg-12"> <h3 style="display:inline-block;"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <span style="line-height:40px;" class='review'><?php if (function_exists("pvc_get_post_views")) { echo pvc_get_post_views($classId); } ?> </span> <span style="line-height:40px;" class='glyphicon glyphicon-eye-open'></span> </div> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text"> <p>Рейтинг: <?php if (function_exists("csr_get_overall_rating_stars")) { echo csr_get_overall_rating_stars($businessId); echo "<span class='tt-ratc'>"; echo csr_get_rating_count($businessId) . " отзыва</span>"; } ?>
?> <a href="<?php the_permalink(); ?> "> <?php the_post_thumbnail(array(252, 252)); ?> <div class="text_block" style="width:92%;"> <h2><?php echo mb_strimwidth(get_the_title(), 0, 44, '...'); ?> </h2> <ul class="info"> <li><span class="glyphicon glyphicon-eye-open"></span><?php echo pvc_get_post_views(get_the_ID()); ?> </li> <li><?php echo number_format_i18n(get_comments_number(get_the_ID())); ?> </li> </ul> </div> </a> <?php } ?> </div> <?php }
the_excerpt(); ?> </div> <div class="pg-metadata"> <ul> <li><?php $pgdDate = get_the_date('d.m.y'); echo $pgdDate; ?> </li> <li></li> <li> <?php //function Post view Count if (function_exists("pvc_get_post_views")) { echo pvc_get_post_views($videoId); } ?> </li> </ul> </div> </div> </div> <?php } } ?> <div class="clearfix"></div> </div>
</div> <?php /* Next three posts */ $args2 = array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'offset' => 3, 'order' => 'DESC', 'tax_query' => array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => array($category->term_id)))); $my_query = null; $my_query = new WP_Query($args2); if ($my_query->have_posts()) { while ($my_query->have_posts()) { $my_query->the_post(); echo '<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 new-post">'; echo '<a href="' . get_permalink(get_the_ID()) . '" class="cat">'; the_post_thumbnail('thumbnail'); echo '<div class="text_block">'; echo '<h2>' . mb_strimwidth(get_the_title(), 0, 45, '...') . '</h2>'; echo '<ul class="info">'; echo '<li><span class="glyphicon glyphicon-eye-open"></span>' . pvc_get_post_views(get_the_ID()) . '</li>'; echo '<li>' . number_format_i18n(get_comments_number(get_the_ID())) . '</li>'; echo '</ul>'; echo '</div>'; echo '</a>'; echo '</div>'; } } wp_reset_query(); ?> <!--Load More Articles --> <div class="mr-morepost-wrap"></div> <div class="clear text-center more"> <a class="mr-more-article-btn" data-block-id="<?php echo $i;
function pvc_most_viewed_posts($args = array(), $display = true) { $defaults = array('number_of_posts' => 5, 'post_types' => array('post'), 'order' => 'desc', 'thumbnail_size' => 'thumbnail', 'show_post_views' => true, 'show_post_thumbnail' => false, 'show_post_excerpt' => false, 'no_posts_message' => __('No Posts', 'post-views-counter')); $args = apply_filters('pvc_most_viewed_posts_args', wp_parse_args($args, $defaults)); $args['show_post_views'] = (bool) $args['show_post_views']; $args['show_post_thumbnail'] = (bool) $args['show_post_thumbnail']; $args['show_post_excerpt'] = (bool) $args['show_post_excerpt']; $posts = pvc_get_most_viewed_posts(array('posts_per_page' => isset($args['number_of_posts']) ? (int) $args['number_of_posts'] : $defaults['number_of_posts'], 'order' => isset($args['order']) ? $args['order'] : $defaults['order'], 'post_type' => isset($args['post_types']) ? $args['post_types'] : $defaults['post_types'])); if (!empty($posts)) { $html = ' <ul>'; foreach ($posts as $post) { setup_postdata($post); $html .= ' <li>'; if ($args['show_post_thumbnail'] && has_post_thumbnail($post->ID)) { $html .= ' <span class="post-thumbnail"> ' . get_the_post_thumbnail($post->ID, $args['thumbnail_size']) . ' </span>'; } $html .= ' <a class="post-title" href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a>' . ($args['show_post_views'] ? ' <span class="count">(' . number_format_i18n(pvc_get_post_views($post->ID)) . ')</span>' : ''); $excerpt = ''; if ($args['show_post_excerpt']) { if (empty($post->post_excerpt)) { $text = $post->post_content; } else { $text = $post->post_excerpt; } if (!empty($text)) { $excerpt = wp_trim_words(str_replace(']]>', ']]>', strip_shortcodes($text)), apply_filters('excerpt_length', 55), apply_filters('excerpt_more', ' ' . '[…]')); } } if (!empty($excerpt)) { $html .= ' <div class="post-excerpt">' . esc_html($excerpt) . '</div>'; } $html .= ' </li>'; } wp_reset_postdata(); $html .= ' </ul>'; } else { $html = $args['no_posts_message']; } $html = apply_filters('pvc_most_viewed_posts_html', $html, $args); if ($display) { echo $html; } else { return $html; } }
$expirationTime = $activeDaysSec + $activateTime; $numDays = ($expirationTime - time()) / 60 / 60 / 24; } ?> <div id="classified"> <div class="form-group business-name"> <h1> <?php the_title(); ?> </h1> <span class='review'> <?php //function Post view Count if (function_exists("pvc_get_post_views")) { echo pvc_get_post_views($businessId); } ?> </span><span class='glyphicon glyphicon-eye-open'></span> </div> <?php $postdata = get_post($businessId, ARRAY_A); ?> <?php if (is_user_logged_in() && get_current_user_id() == $postdata['post_author']) { ?> <div class="bg-expire-2">Размещение вашего бизнеса заканчивается через <?php echo ceil($numDays); ?> дня <?php