/**
 * bf_quick_news_posts() - Render News Posts Helper Function
 * 
 * This function is a quick way to render a news section anywhere in the theme.
 * 
 * @since	0.5.2
 * @return	string						HTML Code
 * @param	string				$class	CSS class selector for the whole DIV area
 * @param	mixed[optional]		$q		Query parameters, takes in the same data as query_posts()
 */
function bf_quick_news_posts($class, $q = '')
{
    global $wpdb;
    wp_reset_query();
    $output = '';
    $query = new WP_Query($q);
    if ($query->have_posts()) {
        ?>
	
		<div class="clearfix hfeed <?php 
        echo $class;
        ?>
">
			<?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
			<div <?php 
            bf_post_class();
            ?>
>
			<?php 
            bf_newsheader();
            ?>
			<?php 
            bf_newsbody();
            ?>
			<?php 
            bf_newsfooter();
            ?>
			</div>
			<?php 
        }
        ?>
		</div><!-- .hfeed -->
	<?php 
    }
}
Example #2
0
    ?>

<div class="hfeed news-list clearfix">
<?php 
    while (have_posts()) {
        the_post();
        ?>
	<div <?php 
        bf_post_class();
        ?>
>
		<?php 
        bf_newsheader();
        ?>
		<?php 
        bf_newsbody();
        ?>
		<?php 
        bf_newsfooter();
        ?>
	</div>
<?php 
    }
    ?>
</div><!-- .hfeed -->

<?php 
}
?>

<?php