/** * Display the widget */ function widget($args, $instance) { extract($args); global $post; $title = $instance['title']; $posts = $instance['posts']; $get_catego = $instance['get_catego']; echo $before_widget; ?> <h2 class="blogpost-wrapper-title"><a href="<?php echo get_category_link($get_catego); ?> "><?php if (get_cat_name($get_catego)) { echo get_cat_name($get_catego); } else { echo $title; } ?> </a> </h2> <div class="blog-lists full "> <?php $magazine_sing_posts = new WP_Query(array('showposts' => $posts, 'cat' => $get_catego)); $count = 1; ?> <ul> <?php while ($magazine_sing_posts->have_posts()) { $magazine_sing_posts->the_post(); ?> <?php if ($count == 1) { ?> <li class="full-left clearfix"> <div <?php post_class('magbig-thumb'); ?> > <?php if (has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> " class="post-thumbnail"> <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'mag-image'); ?> <img src="<?php echo $image[0]; ?> " alt="<?php the_title(); ?> " /> </a> <?php } else { ?> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><img src="<?php echo get_template_directory_uri(); ?> /images/default-image.png" width="60" height="60" alt="<?php the_title(); ?> " /></a> <?php } ?> </div> <div class="list-block clearfix"> <h3><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a></h3> <div class="post-meta-blog"> <span class="meta_author"><?php _e('by', 'imagmag'); ?> <?php the_author_posts_link(); ?> </span> <span class="meta_date"><?php _e('On', 'imagmag'); ?> <?php the_time('F d, Y'); ?> </span> <span class="meta_comments"><?php _e('', 'imagmag'); ?> <a href="<?php comments_link(); ?> "><?php comments_number('0 Comment', '1 Comment', '% Comments'); ?> </a></span> </div> <div class="maga-excerpt clearfix"> <?php imagmag_themepacific_excerpt('tpcrn_home_mag'); ?> </div> </div> </li> <?php } else { ?> <li class="full-right"> <div class="sb-post-thumbnail"> <?php if (has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'sb-post-thumbnail'); ?> <img src="<?php echo $image[0]; ?> " alt="<?php the_title(); ?> " /></a> <?php } else { ?> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><img src="<?php echo get_template_directory_uri(); ?> /images/default-image.png" width="60" height="60" alt="<?php the_title(); ?> " /></a> <?php } ?> </div> <div class="blog-lists-title"> <h3><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a></h3> <div class="time clearfix"> <span class="date"><?php the_time('F d, Y'); ?> </span> </div> </div> </li> <?php } ?> <?php $count++; } wp_reset_query(); ?> </ul> </div> <?php echo $after_widget; }
<span class="meta_comments"><?php _e('', 'imagmag'); ?> <a href="<?php comments_link(); ?> "><?php comments_number('0 Comment', '1 Comment', '% Comments'); ?> </a></span> </div> <div class="maga-excerpt clearfix"> <?php imagmag_themepacific_excerpt('tpcrn_home_mag'); ?> </div> </div> </li></ul> <br class="clear" /> </div> </div> <?php } ?> <?php } else { ?>