<article id="post-<?php the_ID(); ?> " <?php post_class('clearfix'); ?> > <header> <?php if (isset($opt['show']['tags']) && $opt['show']['tags'] && largo_has_categories_or_tags() && $tags === 'top') { ?> <h5 class="top-tag"><?php largo_top_term(); ?> </h5> <?php } ?> <h2 class="entry-title"> <a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(array('before' => __('Permalink to', 'largo') . ' ')); ?> " rel="bookmark"><?php the_title();
the_post_thumbnail('full'); echo '</a>'; } ?> </div> </header> <?php } // end Homepage Featured thumbnail block $entry_classes = 'entry-content'; if ($featured) { $entry_classes .= ' span10 with-hero'; } echo '<div class="' . $entry_classes . '">'; if (largo_has_categories_or_tags() && $tags === 'top') { echo '<h5 class="top-tag">' . largo_top_term($args = array('echo' => FALSE)) . '</h5>'; } if (!$featured) { echo '<div class="has-thumbnail ' . $hero_class . '"><a href="' . get_permalink() . '">' . get_the_post_thumbnail() . '</a></div>'; } ?> <h2 class="entry-title"> <a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(array('before' => __('Permalink to', 'largo') . ' ')); ?> " rel="bookmark"><?php the_title();
<?php } ?> <div class="dismiss"> <a href="#"> <i class="icon-cancel"></i> </a> </div> <?php // The category RSS and author follow links ?> <?php // Get the category object $cat_feed_link = largo_top_term(array('use_icon' => 'rss', 'rss' => true, 'echo' => false)); // Set one of two author objects (leave other null). // We make $coauthor a one dimensional array if author hasn't been overwritten. $coauthors = null; if (get_post_meta($post->ID, 'largo_byline_text')) { $byline_text = esc_attr(get_post_meta($post->ID, 'largo_byline_text', true)); $byline_link = esc_attr(get_post_meta($wp_query->post->ID, 'largo_byline_link', true)); } else { if (function_exists('get_coauthors')) { $coauthors = get_coauthors($post->ID); } else { $coauthors = array(get_userdata($post->post_author)); } } ?> <div class="follow">
<?php // The top term $top_term_args = array('echo' => false); if (isset($instance['show_top_term']) && $instance['show_top_term'] == 1 && largo_has_categories_or_tags()) { ?> <h5 class="top-tag"><?php echo largo_top_term($top_term_args); ?> </h5> <?php } // the thumbnail image (if we're using one) if ($thumb == 'small') { $img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left'; $img_attr = array('class' => $img_location . '-align'); $img_attr['class'] .= " attachment-small"; ?> <a href="<?php echo get_permalink(); ?> "><?php echo get_the_post_thumbnail(get_the_ID(), '60x60', $img_attr); ?> </a> <?php } elseif ($thumb == 'medium') { $img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left'; $img_attr = array('class' => $img_location . '-align'); $img_attr['class'] .= " attachment-thumbnail"; ?>
function homepage_feature_stories_list() { global $shown_ids; $max = 3; /** * Filter the maximum number of posts to show in the featured stories list * on the HomepageSingleWithFeatured homepage template. * * This is used in the query for the series list of posts in the same series * as the main feature. This is the maximum number of posts that will display * in the list. * * Default value is 3. * * @since 0.5.1 * * @param int $var minimum number of posts that can show. */ $max = apply_filters('largo_homepage_feature_stories_list_maximum', $max); ob_start(); $featured_stories = largo_home_featured_stories($max); foreach ($featured_stories as $featured) { $shown_ids[] = $featured->ID; ?> <article class="featured-story"> <h5 class="top-tag"><?php largo_top_term('post=' . $featured->ID); ?> </h5> <h4 class="related-story"><a href="<?php echo esc_url(get_permalink($featured->ID)); ?> "> <?php echo $featured->post_title; ?> </a></h4> </article> <?php } $ret = ob_get_contents(); ob_end_clean(); return $ret; }
/** * Outputs the content of the recent posts widget. * * @param array $args widget arguments. * @param array $instance saved values from databse. */ function widget($args, $instance) { global $post, $shown_ids; // an array of post IDs already on a page so we can avoid duplicating posts; // Preserve global $post $preserve = $post; extract($args); $posts_term = of_get_option('posts_term_plural', 'Posts'); // Add the link to the title. $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent ' . $posts_term, 'largo') : $instance['title'], $instance, $this->id_base); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $thumb = isset($instance['thumbnail_display']) ? $instance['thumbnail_display'] : 'small'; $excerpt = isset($instance['excerpt_display']) ? $instance['excerpt_display'] : 'num_sentences'; $query_args = array('post__not_in' => get_option('sticky_posts'), 'showposts' => $instance['num_posts'], 'post_status' => 'publish'); if (isset($instance['avoid_duplicates']) && $instance['avoid_duplicates'] === 1) { $query_args['post__not_in'] = $shown_ids; } if ($instance['cat'] != '') { $query_args['cat'] = $instance['cat']; } if ($instance['tag'] != '') { $query_args['tag'] = $instance['tag']; } if ($instance['author'] != '') { $query_args['author'] = $instance['author']; } if ($instance['taxonomy'] != '') { $query_args['tax_query'] = array(array('taxonomy' => $instance['taxonomy'], 'field' => 'slug', 'terms' => $instance['term'])); } echo '<ul>'; $my_query = new WP_Query($query_args); if ($my_query->have_posts()) { $output = ''; while ($my_query->have_posts()) { $my_query->the_post(); $shown_ids[] = get_the_ID(); // wrap the items in li's. $output .= '<li>'; // The top term $top_term_args = array('echo' => false); if (isset($instance['show_top_term']) && $instance['show_top_term'] == 1 && largo_has_categories_or_tags()) { $output .= '<h5 class="top-tag">' . largo_top_term($top_term_args) . '</h5>'; } // the thumbnail image (if we're using one) if ($thumb == 'small') { $img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left'; $img_attr = array('class' => $img_location . '-align'); $img_attr['class'] .= " attachment-small"; $output .= '<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), '60x60', $img_attr) . '</a>'; } elseif ($thumb == 'medium') { $img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left'; $img_attr = array('class' => $img_location . '-align'); $img_attr['class'] .= " attachment-thumbnail"; $output .= '<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), 'post-thumbnail', $img_attr) . '</a>'; } elseif ($thumb == 'large') { $img_attr = array(); $img_attr['class'] .= " attachment-large"; $output .= '<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), 'large', $img_attr) . '</a>'; } // the headline $output .= '<h5><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>'; // byline on posts if (isset($instance['show_byline']) && $instance['show_byline'] == true) { $output .= '<span class="byline">' . largo_byline(false) . '</span>'; } // the excerpt if ($excerpt == 'num_sentences') { $output .= '<p>' . largo_trim_sentences(get_the_content(), $instance['num_sentences']) . '</p>'; } elseif ($excerpt == 'custom_excerpt') { $output .= '<p>' . get_the_excerpt() . '</p>'; } // read more link if (isset($instance['show_read_more']) && $instance['show_read_more'] === 1) { $output .= '<p class="more-link"><a href="' . get_permalink() . '">' . __('Read More', 'largo') . '</a></p>'; } // close the item $output .= '</li>'; } // print all of the items echo $output; } else { printf(__('<p class="error"><strong>You don\'t have any recent %s.</strong></p>', 'largo'), strtolower($posts_term)); } // end more featured posts // close the ul if we're just showing a list of headlines if ($excerpt == 'none') { echo '</ul>'; } if ($instance['linkurl'] != '') { echo '<p class="morelink"><a href="' . esc_url($instance['linkurl']) . '">' . esc_html($instance['linktext']) . '</a></p>'; } echo $after_widget; // Restore global $post wp_reset_postdata(); $post = $preserve; }