if ($post_cat == '1') { echo '<p class="cat-slider">'; echo the_category(', ') . '</p>'; } ?> <div class="caption-slider-text"> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <?php echo themeloy_single_post_meta(get_the_ID()); ?> <?php $post_review = get_post_custom_values('enable_review_themeloy_select', $post_id); $post_review = $post_review[0] != '' ? $post_review[0] : of_get_option('enable_all_review'); $total_review = absint(themeloy_get_total_review($post_id)); if ($post_review == '1') { ?> <div class="ratings"> <div class="rating-box"> <div class="rating" style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?> %"></div> </div>
function block($instance) { extract($instance); $titles = apply_filters('widget_title', empty($instance['titles']) ? ' ' : $instance['titles'], $instance, $this->id_base); if (!($number_show = absint($instance['number_show']))) { $number_show = 5; } if (!isset($instance["cats"])) { $cats = ''; } $themeloy_args = array('showposts' => $number_show, 'category__in' => $cats); $themeloy_widget = null; $themeloy_widget = new WP_Query($themeloy_args); // Post list in widget> ?> <div class="widget post_list_medium_widget"> <?php if (!empty($instance['titles'])) { ?> <h3 class="widget-title"><span><?php echo $instance["titles"]; ?> </span></h3><?php } ?> <div class="widget_container"> <div class="slider-wrapper-content theme-default"> <div id="slider" class="nivoSlider nivoSlider_content"> <?php $i = 0; while ($themeloy_widget->have_posts()) { $i++; $themeloy_widget->the_post(); $post_id = get_the_ID(); ?> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title_attribute(); ?> "> <?php if (has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'slider-normal'); ?> <img src="<?php echo $image[0]; ?> " title="<?php echo '#htmlcaption' . $i; ?> " data-transition="<?php echo of_get_option('slider_effect_option'); ?> " /> <?php } else { echo '<img src="' . get_template_directory_uri() . '/images/demo/slider-image.jpg' . '" title="#htmlcaption-slide' . $i . '">'; } ?> </a> <?php } ?> </div> <?php $i = 0; while ($themeloy_widget->have_posts()) { $themeloy_widget->the_post(); $i++; $post_id = get_the_ID(); ?> <div id="htmlcaption<?php echo $i; ?> " class="nivo-html-caption"> <?php $post_cat = get_post_custom_values('cat_themeloy_select', get_the_ID()); $post_cat = $post_cat[0] != '' ? $post_cat[0] : of_get_option('blog_category_post'); if ($post_cat == '1') { echo '<p class="cat-slider">'; echo the_category(', ') . '</p>'; } ?> <div class="caption-slider-text"> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <?php echo themeloy_single_post_meta(get_the_ID()); ?> <?php $post_review = get_post_custom_values('enable_review_themeloy_select', $post_id); $post_review = $post_review[0] != '' ? $post_review[0] : of_get_option('enable_all_review'); $total_review = absint(themeloy_get_total_review($post_id)); if ($post_review == '1') { ?> <div class="ratings"> <div class="rating-box"> <div class="rating" style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?> %"></div> </div> </div> <?php } ?> </div> </div> <?php } ?> </div> </div></div> <?php wp_reset_query(); }
function block($instance) { extract($instance); $titles = apply_filters('widget_title', empty($instance['titles']) ? 'Recent Posts' : $instance['titles'], $instance, $this->id_base); $title1 = apply_filters('widget_title', empty($instance['title1']) ? 'Recent Posts' : $instance['title1'], $instance, $this->id_base); if (!($number_show = absint($instance['number_show']))) { $number_show = 5; } if (!($number_show1 = absint($instance['number_show1']))) { $number_show1 = 5; } if (!isset($instance["cats"])) { $cats = ''; } if (!isset($instance["cats1"])) { $cats1 = ''; } // array to call recent posts. $themeloy_args = array('showposts' => $number_show1, 'category__in' => $cats); $themeloy_args1 = array('showposts' => $number_show, 'category__in' => $cats1); $themeloy_widget = null; $themeloy_widget = new WP_Query($themeloy_args); // Widget title // Post list in widget $i = 0; ?> <div class="widget main_post_style clearfix"> <div class="widget_container"> <div class="main_post small-slider-list"> <?php if (!empty($instance['titles'])) { ?> <h3 class="widget-title"><span><?php echo $instance["titles"]; ?> </span></h3><?php } ?> <div class="slider-wrapper-content theme-default"> <div id="slider" class="nivoSlider nivoSlider_content"> <?php $i = 0; while ($themeloy_widget->have_posts()) { $i++; $themeloy_widget->the_post(); $post_id = get_the_ID(); ?> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title_attribute(); ?> "> <?php if (has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'slider-left-small'); ?> <img src="<?php echo $image[0]; ?> " title="<?php echo '#htmlcaption-left' . $i; ?> " data-transition="<?php echo of_get_option('slider_effect_option'); ?> " /> <?php } else { echo '<img src="' . get_template_directory_uri() . '/images/demo/slider-left-small.jpg' . '" title="#htmlcaption-slide' . $i . '">'; } ?> </a> <?php } ?> </div> <?php $i = 0; while ($themeloy_widget->have_posts()) { $themeloy_widget->the_post(); $i++; $post_id = get_the_ID(); ?> <div id="htmlcaption-left<?php echo $i; ?> " class="nivo-html-caption"> <?php $post_cat = get_post_custom_values('cat_themeloy_select', get_the_ID()); $post_cat = $post_cat[0] != '' ? $post_cat[0] : of_get_option('blog_category_post'); if ($post_cat == '1') { echo '<p class="cat-slider">'; echo the_category(', ') . '</p>'; } ?> <div class="caption-slider-text"> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <?php echo themeloy_single_post_meta(get_the_ID()); ?> <?php $post_review = get_post_custom_values('enable_review_themeloy_select', $post_id); $post_review = $post_review[0] != '' ? $post_review[0] : of_get_option('enable_all_review'); $total_review = absint(themeloy_get_total_review($post_id)); if ($post_review == '1') { ?> <div class="clear"></div> <div class="ratings"> <div class="rating-box"> <div class="rating" style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?> %"></div> </div> </div> <?php } ?> </div> </div> <?php } ?> </div> </div> <div class="list_post_vertical home_slider_carousel"> <?php if (!empty($instance['title1'])) { ?> <h3 class="widget-title"><span><?php echo $instance["title1"]; ?> </span></h3><?php } ?> <ul id="mycarousel" class="jcarousel_vertical jcarousel-skin-tango"> <?php wp_reset_query(); $themeloy_widget1 = null; $themeloy_widget1 = new WP_Query($themeloy_args1); while ($themeloy_widget1->have_posts()) { $themeloy_widget1->the_post(); $post_id = get_the_ID(); ?> <li> <?php $post_date = get_post_custom_values('date_themeloy_select', get_the_ID()); $post_date = $post_date[0] != '' ? $post_date[0] : of_get_option('blog_date_post'); if ($post_date == '1') { ?> <div class="feature_post_style"> <span class="post_date"><span class="date_number"><?php echo get_the_date('d'); ?> </span> <?php echo get_the_date('M'); ?> <i class="icon-caret-right feature-icon-right"></i> </span> <span class="post_time"><i class="icon-time"></i> <?php echo get_the_time('H:i'); ?> </span> </div> <?php } ?> <div class="feature-link feature-item"> <a href="<?php the_permalink(); ?> " class="feature-link"> <?php if (has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'medium-feature'); ?> <img src="<?php echo $image[0]; ?> " /> <?php } else { echo '<img src="' . get_template_directory_uri() . '/images/demo/medium-feature.jpg' . '">'; } ?> </a> <?php echo themeloy_post_type(); ?> </div> <div class="list_desc"> <h4 class="list_title"><a class="post-title" href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title_attribute(); ?> "> <?php the_title(); ?> </a></h4> <?php echo themeloy_feature_post_meta(get_the_ID()); ?> <?php $post_review = get_post_custom_values('enable_review_themeloy_select', $post_id); $post_review = $post_review[0] != '' ? $post_review[0] : of_get_option('enable_all_review'); $total_review = absint(themeloy_get_total_review($post_id)); if ($post_review == '1') { ?> <div class="ratings"> <div class="rating-box"> <div class="rating" style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?> %"></div> </div> </div> <?php } ?> </div> </li> <?php } ?> </ul> </div> </div> </div> <?php wp_reset_query(); }
if (have_posts()) { while (have_posts()) { the_post(); ?> <?php $categories = get_the_category(); $tags = get_the_tags(); $post_id = get_the_ID(); ?> <h2 itemprop="name" class="entry-title post-title"><?php the_title(); ?> </h2> <?php echo themeloy_single_post_meta($post_id); ?> <hr class="none" /> <?php if (of_get_option('blog_post_feautre') == 1) { ?> <?php $image_feature = wp_get_attachment_url(get_post_thumbnail_id($post_id, 'full')); ?> <?php if (!empty($image_feature)) { ?> <img src="<?php echo $image_feature;