?> </p> <?php } ?> <div class="main-spacer"></div> <div class="menu-display-1-wrapper"> <div class="menu-display-1"> <?php if ($my_query->have_posts()) { while ($my_query->have_posts()) { $my_query->the_post(); ?> <?php $image = ot_image_html($my_query->post->ID, 180, 121); $price = get_post_meta($my_query->post->ID, THEME_NAME . '_price', true); global $product; ?> <div class="item"> <h5><?php the_title(); ?> </h5> <a href="<?php the_permalink(); ?> " class="image"> <?php if ($price && $type == "1") { ?>
wp_reset_query(); //get image settings $imageSize = get_post_meta($post->ID, THEME_NAME . "_image_size", true); //custom image size $imageType = get_option(THEME_NAME . "_image_type"); //default image size if (!$imageSize) { $imageSize = $imageType; } if ($imageSize == "large") { $width = 600; $height = 180; $class = "post-image-2"; } else { $width = 170; $height = 170; $class = "post-image-1"; } $image = get_post_thumb($post->ID, $width, $height); //post details $singleImage = get_post_meta($post->ID, THEME_NAME . "_single_image", true); if (get_option(THEME_NAME . "_show_single_thumb") == "on" && $singleImage == "show" && $image['show'] == true || get_option(THEME_NAME . "_show_single_thumb") == "on" && !$singleImage && $image['show'] == true) { ?> <?php echo ot_image_html($post->ID, $width, $height, $class); ?> <?php }
$blogStyle = ot_get_option($catId, "blog_style"); } else { $blogStyle = get_option(THEME_NAME . "_blog_style"); } if (!isset($blogStyle) || $blogStyle == "") { $blogStyle = get_option(THEME_NAME . "_blog_style"); } if ($blogStyle == "2") { $width = 600; $height = 180; } else { $width = 100; $height = 100; } $image = get_post_thumb($post->ID, $width, $height); if (get_option(THEME_NAME . "_show_first_thumb") == "on" && $image['show'] == true) { ?> <div class="image"> <a href="<?php the_permalink(); ?> "> <?php echo ot_image_html($post->ID, $width, $height); ?> </a> </div> <?php }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $countP = $instance['count_p']; $countR = $instance['count_r']; $countC = $instance['count_c']; //popular post args $argsP = array('posts_per_page' => $countP, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => THEME_NAME . '_post_views_count', 'post_type' => 'post'); //recent post args $argsR = array('posts_per_page' => $countR); //commnet post args $argsC = array('status' => 'approve', 'order' => 'DESC', 'number' => $countC); $comments = get_comments($argsC); $totalCount = count($comments); $the_query_p = new WP_Query($argsP); $the_query_r = new WP_Query($argsR); //post counts $totalCountP = $the_query_p->found_posts; $totalCountR = $the_query_r->found_posts; $blogID = get_option('page_for_posts'); $postDate = get_option(THEME_NAME . "_post_date"); $postComments = get_option(THEME_NAME . "_post_comment"); ?> <?php echo $before_widget; ?> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <div class="tabs"> <ul class="tab-navi"> <li class="active"><a href="#"><span><?php _e("Popular", THEME_NAME); ?> </span></a></li> <li><a href="#"><span><?php _e("Recent", THEME_NAME); ?> </span></a></li> <li><a href="#"><span><?php _e("Comments", THEME_NAME); ?> </span></a></li> </ul> <!-- BEGIN .latest-activity --> <div class="latest-activity active"> <?php if ($the_query_p->have_posts()) { while ($the_query_p->have_posts()) { $the_query_p->the_post(); ?> <?php $image = get_post_thumb($the_query_p->post->ID, 0, 0); ?> <div class="activity-item<?php if ($image['show'] != true) { ?> no-image<?php } ?> "> <div class="image"> <?php if ($image['show'] == true) { ?> <a href="<?php the_permalink(); ?> "> <?php echo ot_image_html($the_query_p->post->ID, 60, 60); ?> </a> <?php } ?> </div> <div class="text"> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <p><a href="<?php the_permalink(); ?> " class="more-link"><i><?php _e("Read more", THEME_NAME); ?> </i></a></p> </div> </div> <?php } } else { ?> <p><?php _e('No posts where found', THEME_NAME); ?> </p> <?php } ?> <!-- END .latest-activity --> </div> <!-- BEGIN .latest-activity --> <div class="latest-activity"> <?php if ($the_query_r->have_posts()) { while ($the_query_r->have_posts()) { $the_query_r->the_post(); ?> <?php $image = get_post_thumb($the_query_r->post->ID, 0, 0); ?> <div class="activity-item<?php if ($image['show'] != true) { ?> no-image<?php } ?> "> <div class="image"> <?php if ($image['show'] == true) { ?> <a href="<?php the_permalink(); ?> "> <?php echo ot_image_html($the_query_r->post->ID, 60, 60); ?> </a> <?php } ?> </div> <div class="text"> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <p><a href="<?php the_permalink(); ?> " class="more-link"><i><?php _e("Read more", THEME_NAME); ?> </i></a></p> </div> </div> <?php } } else { ?> <p><?php _e('No posts where found', THEME_NAME); ?> </p> <?php } ?> <!-- END .latest-activity --> </div> <!-- BEGIN .latest-activity --> <div class="latest-activity"> <?php foreach ($comments as $comment) { if ($comment->user_id && $comment->user_id != "0") { $authorName = get_the_author_meta('display_name', $comment->user_id); } else { $authorName = $comment->comment_author; } ?> <div class="activity-item"> <div class="image"> <a href="<?php echo get_comment_link($comment); ?> "> <img src="<?php echo get_avatar_url(get_avatar($comment, 60)); ?> " alt="<?php echo $authorName; ?> " /> </a> </div> <div class="text"> <h5><a href="<?php echo get_comment_link($comment); ?> "><?php echo $authorName; ?> </a></h5> <p><?php comment_excerpt($comment->comment_ID); ?> </p> <p><a href="<?php echo get_comment_link($comment); ?> " class="more-link"><i><?php _e("View article", THEME_NAME); ?> </i></a></p> </div> </div> <?php } ?> <!-- END .latest-activity --> </div> </div> <?php echo $after_widget; ?> <?php }