示例#1
0
/**
 * 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 
    }
}
示例#2
0
<?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 
bf_below_index_news();
?>