<?php /** * Page Content Template * @package Soused */ ?> <div id="post-<?php the_ID(); ?> " <?php post_class('page-result'); ?> > <h2 class="post-title"><?php echo capitalizeString(get_the_title()); ?> </h2> <?php if (get_theme_mod('soused_single_page_featured') == 1 && has_post_thumbnail()) { /* * Thumbnail */ ?> <div class="featured responsive single-page"> <a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?>
function widget($args, $instance) { extract($args, EXTR_SKIP); //$args Array Into Individual Variables //The Query $args = array('posts_per_page' => $instance['number_of_posts'], 'post_type' => 'post', 'meta_query' => array('relation' => 'AND', array('key' => 'soused-bestof-checkbox', 'value' => '1'), array('key' => '_thumbnail_id')), 'orderby' => 'date', 'order' => 'DESC'); $the_query = new WP_Query($args); if ($the_query->have_posts()) { //If Best Of Articles Exist echo $before_widget; $widgetTitle = apply_filters('widget_title', $instance['title']); if (!empty($widgetTitle)) { echo $before_title . $widgetTitle . $after_title; } while ($the_query->have_posts()) { $the_query->the_post(); ?> <div class="bestof-container"> <a href="<?php the_permalink(); ?> " class="bestof-image"> <?php the_post_thumbnail('medium'); ?> </a> <a href="<?php the_permalink(); ?> " class="bestof-title"><?php echo capitalizeString(get_the_title()); ?> </a> </div> <?php } echo $after_widget; } //Restore original Post Data wp_reset_postdata(); }