?> </div> <div class="post_content"> <h2 class="postitle"><a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?> "><?php the_title(); ?> </a></h2> <?php trt_excerpt('trt_excerptlength_teaser', 'trt_excerptmore'); ?> <a class="read_mor" href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?> "><?php _e('Read More →', 'triton'); ?> </a> </div> </div> <?php }
function widget($args, $instance) { extract($args); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title']); $num = $instance['num']; $cat = $instance['cat']; /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } /* Display a containing div */ echo '<div class="trt_feat">'; /* Display Posts */ if ($num) { $popular = new WP_Query('cat=' . $cat . ' &posts_per_page=' . $num); } echo '<ul>'; while ($popular->have_posts()) { $popular->the_post(); echo '<li>'; echo '<a class="trt_wgt_thumb" href="' . get_permalink(get_the_ID()) . '" title="' . get_the_title() . '">'; if (has_post_thumbnail()) { echo '' . the_post_thumbnail('thumbnail') . ''; } elseif ($photo = trt_get_images('numberposts=1', true)) { echo '' . wp_get_attachment_image($photo[0]->ID, $size = 'thumbnail') . ''; } else { echo '<img src="' . get_template_directory_uri() . '/images/blank_img2.png" alt="' . get_the_title() . '" class="thumbnail"/>'; } echo '</a>'; echo '<div class="widget_content">'; echo '<a class="trt_wgt_tt" href="' . get_permalink(get_the_ID()) . '" title="' . get_the_title() . '">' . get_the_title() . '</a><br />'; echo '' . trt_excerpt('trt_excerptlength_index', 'trt_excerptmore') . ''; echo '</div>'; echo '</li>'; } echo '</ul>'; echo '</div>'; /* After widget (defined by themes). */ echo $after_widget; }