?> </div> <?php } ?> <a href="<?php the_permalink(); ?> "><?php the_post_thumbnail('medium'); ?> </a></div> <?php } elseif ($photo = trt_get_images('numberposts=1', true)) { ?> <div class="imgwrap"> <?php if ($option["trt_diss_date"] == "1") { } else { ?> <div class="date_meta"><?php the_time('d'); ?> . <?php the_time('m'); ?> . <?php the_time('Y');
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; }