Esempio n. 1
0
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
					<h5 class="byline"><?php 
            largo_byline();
            ?>
</h5>
					<?php 
            largo_excerpt($post, 4, false);
            ?>
					<?php 
            if (largo_post_in_series()) {
                $feature = largo_get_the_main_feature();
                $feature_posts = largo_get_recent_posts_for_term($feature, 1, 1);
                if ($feature_posts) {
                    foreach ($feature_posts as $feature_post) {
                        ?>
								<h4 class="related-story">
									<?php 
                        _e('RELATED:', 'largo');
                        ?>
 <a href="<?php 
                        echo esc_url(get_permalink($feature_post->ID));
                        ?>
"><?php 
                        echo get_the_title($feature_post->ID);
                        ?>
</a>
Esempio n. 2
0
/**
 * Returns a short list (3 posts) of stories in the same series as the main feature
 **/
function homepage_series_stories_list()
{
    global $shown_ids;
    $feature = largo_get_the_main_feature(largo_home_single_top());
    $min = 2;
    $max = 3;
    /**
     * Filter the minimum number of posts to show in a series list in the
     * HomepageSingleWithSeriesStories homepage list.
     *
     * This is used in the query for the series list of posts in the same series
     * as the main feature. If fewer than this number of posts exist, the list
     * is hidden and the headline dominates the full box.
     * 
     * Default value is 2.
     *
     * @since 0.5.1
     *
     * @param int  $var minimum number of posts that can show.
     */
    $min = apply_filters('largo_homepage_series_stories_list_minimum', $min);
    /**
     * Filter the maximum number of posts to show in a series list in the
     * HomepageSingleWithSeriesStories homepage list.
     *
     * 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_series_stories_list_maximum', $max);
    $series_posts = largo_get_recent_posts_for_term($feature, $max, $min);
    ob_start();
    if (!empty($feature)) {
        ?>
	<h5 class="top-tag"><a class="post-category-link" href="<?php 
        echo get_term_link($feature);
        ?>
">
		<?php 
        echo __("More in", "largo") . " " . esc_html($feature->name);
        ?>
</a></h5>
			<?php 
        foreach ($series_posts as $series_post) {
            $shown_ids[] = $series_post->ID;
            ?>
				<h4 class="related-story"><a href="<?php 
            echo esc_url(get_permalink($series_post->ID));
            ?>
">
					<?php 
            echo get_the_title($series_post->ID);
            ?>
</a></h4>
			<?php 
        }
        ?>
			<p class="more"><a href="<?php 
        echo get_term_link($feature);
        ?>
">
				<?php 
        _e('Complete Coverage', 'largo');
        ?>
</a></p>
<?php 
    }
    wp_reset_postdata();
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}