if (ar2_get_theme_option('post_display[post_author]')) { ?> <div class="entry-author"> <?php printf(__('Posted by %1$s %2$s', 'ar2'), '<address class="author vcard"><a rel="author" class="url fn n" href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . esc_attr(get_the_author()) . '">' . get_the_author() . '</a></address>', '<abbr class="published">' . ar2_posted_on(false) . '</abbr>'); ?> <?php edit_post_link(__('Edit', 'ar2')); ?> </div> <?php } else { ?> <div class="entry-author"> <?php printf(__('Posted %s', 'ar2'), '<abbr class="published">' . ar2_posted_on(false) . '</abbr>'); ?> <?php edit_post_link(__('Edit', 'ar2')); ?> </div> <?php } ?> <?php if (ar2_get_theme_option('post_display[excerpt]') && has_excerpt()) { ?> <div class="entry-excerpt"><?php the_excerpt(); ?>
<span class="entry-comments"><?php echo get_comments_number(); ?> </span> </a> </div> <h3 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h3> <?php if (ar2_get_theme_option('nodebased_show_excerpts')) { ?> <abbr class="published"><?php printf(__('Posted %s', 'ar2'), ar2_posted_on(false)); ?> </abbr> <div class="entry-summary"><?php the_excerpt(); ?> </div> <?php } ?> </div>
/** * Shared function to display certain posts in the widget. * @since 1.3 */ function ar2_widgets_post_loop($id, $args = array()) { global $wp_query; $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => 1)); $args['query'] = wp_parse_args($args['query'], $_defaults['query']); $args = wp_parse_args($args, $_defaults); $q = new WP_Query($args['query']); if ($q->have_posts()) { echo '<ul class="' . $id . '">'; while ($q->have_posts()) { $q->the_post(); // hack for plugin authors who love to use $post = $wp_query->post $wp_query->post = $q->post; setup_postdata($q->post); ?> <li <?php post_class(); ?> > <?php if ($args['show_thumbs']) { ?> <a class="entry-thumbnail" href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php echo ar2_get_thumbnail('sidebar-thumb', get_the_ID()); ?> </a> <?php } ?> <a class="entry-title" rel="bookmark" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <small><?php printf(__('Posted %s', 'ar2'), ar2_posted_on(false)); ?> </small> <?php if ($args['show_excerpt']) { ?> <p class="entry-content"> <?php echo get_the_excerpt(); ?> </p> <?php } ?> </li> <?php } echo '</ul>'; } else { echo '<small>' . __('No posts at the moment. Check back again later!', 'ar2') . '</small>'; } wp_reset_query(); }