function widget($args, $instance)
    {
        global $post;
        // Preserve global $post
        $preserve = $post;
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('In Case You Missed It', 'largo') : $instance['title'], $instance, $this->id_base);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

			<?php 
        $missedit = largo_get_featured_posts(array('tax_query' => array(array('taxonomy' => 'prominence', 'field' => 'slug', 'terms' => 'footer-featured')), 'showposts' => $instance['num_posts']));
        if ($missedit->have_posts()) {
            ?>
             	 <?php 
            while ($missedit->have_posts()) {
                $missedit->the_post();
                ?>
                  	<div class="post-lead clearfix">
                      	<?php 
                the_post_thumbnail('60x60');
                ?>
                      	<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
                      	<?php 
                echo '<p>' . largo_trim_sentences(get_the_content(), $instance['num_sentences']) . '</p>';
                ?>
                  	</div> <!-- /.post-lead -->
	            <?php 
            }
            ?>
	            <?php 
        } else {
            ?>
	    		<p class="error"><strong><?php 
            _e('You don\'t presently have any posts in the footer featured category.</strong> Mark more posts as featured on the add/edit post screen to populate this region.', 'largo');
            ?>
</p>

    		<?php 
        }
        // end more featured posts
        ?>



		<?php 
        echo $after_widget;
        // Restore global $post
        wp_reset_postdata();
        $post = $preserve;
    }
Esempio n. 2
0
<?php

global $tags, $shown_ids;
$topstory = largo_get_featured_posts(array('tax_query' => array(array('taxonomy' => 'prominence', 'field' => 'slug', 'terms' => 'top-story')), 'showposts' => 1));
if (!empty($topstory)) {
    ?>
	<div id="homepage-featured" class="row-fluid clearfix">
		<div class="top-story span12">
		<?php 
    if ($topstory->have_posts()) {
        while ($topstory->have_posts()) {
            $topstory->the_post();
            $shown_ids[] = get_the_ID();
            if ($has_video = get_post_meta($post->ID, 'youtube_url', true)) {
                ?>
						<div class="embed-container">
							<iframe src="http://www.youtube.com/embed/<?php 
                echo substr(strrchr($has_video, "="), 1);
                ?>
?modestbranding=1" frameborder="0" allowfullscreen></iframe>
						</div>
					<?php 
            } else {
                ?>
						<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_post_thumbnail('large');
                ?>
</a>
Esempio n. 3
0
            }
        }
    }
}
// end top story
?>
	</div>

	<?php 
if (largo_get_active_homepage_layout() !== 'LegacyThreeColumn') {
    ?>
		<div class="sub-stories span4">
			<?php 
    $showposts = 6;
    $showposts = apply_filters('largo_homepage_topstories_post_count', $showposts);
    $substories = largo_get_featured_posts(array('tax_query' => array(array('taxonomy' => 'prominence', 'field' => 'slug', 'terms' => 'homepage-featured')), 'showposts' => $showposts, 'post__not_in' => $shown_ids));
    if ($substories->have_posts()) {
        $count = 1;
        while ($substories->have_posts()) {
            $substories->the_post();
            $shown_ids[] = get_the_ID();
            if ($count <= 3) {
                ?>
						<div <?php 
                post_class('story');
                ?>
 >
							<?php 
                if (largo_has_categories_or_tags() && $tags === 'top') {
                    ?>
								<h5 class="top-tag"><?php