?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h1> <div class="short-description"> <?php if (strpos(get_the_content(), '#more-')) { the_content(sprintf(__('Continue reading %s', 'charitas'), the_title('<span class="screen-reader-text">', '</span>', false))); } else { echo "<p>"; echo charitas_short_excerpt('40'); echo "</p>"; } ?> <?php wp_link_pages(array('before' => '<div class="clear"></div><div class="page-link"><span>' . __('Pages:', 'charitas') . '</span>', 'after' => '</div>')); ?> </div> <div class="entry-meta"> <!-- Date --> <?php if (ot_get_option('charitas_date_blog_post') != "off") { ?>
public function widget($args, $instance) { global $post; extract($args); $title = apply_filters('widget_title', $instance['title']); $categories = apply_filters('widget_categories', $instance['categories']); $nr_posts = apply_filters('widget', $instance['nr_posts']); $read_more_link = apply_filters('widget', $instance['read_more_link']); $clear_after = apply_filters('widget_clear_after', $instance['clear_after']); ?> <?php if ($categories < '1') { $args = array('ignore_sticky_posts' => 1, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $nr_posts); } else { $args = array('ignore_sticky_posts' => 1, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $nr_posts, 'cat' => $categories); } $posts = null; $posts = new WP_Query($args); ?> <?php if ($posts->have_posts()) { ?> <aside class="widget WPlookPosts"> <div class="widget-title"> <h3><?php echo $title; ?> </h3> <?php if ($read_more_link != "") { ?> <div class="viewall fright"><a href="<?php echo $read_more_link; ?> " class="radius" title="<?php _e('View all posts', 'charitas'); ?> "><?php _e('view all', 'charitas'); ?> </a></div> <?php } ?> <div class="clear"></div> </div> <div class="widget-causes-body"> <?php while ($posts->have_posts()) { $posts->the_post(); ?> <article class="cause-item"> <?php if (has_post_thumbnail()) { ?> <figure> <a title="<?php the_title(); ?> " href="<?php the_permalink(); ?> "> <?php the_post_thumbnail('charitas-lite-small-thumb'); ?> <div class="mask radius"> <div class="mask-square"><i class="icon-link"></i></div> </div> </a> </figure> <?php } ?> <h3 class="entry-header"> <a title="<?php the_title(); ?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h3> <div class="short-description"> <p><?php echo charitas_short_excerpt('15'); ?> </p> </div> </article> <?php } wp_reset_postdata(); ?> </div> </aside> <?php if ($clear_after == "0") { ?> <div class="clear-widget"></div> <?php } ?> <?php } ?> <?php }