<?php

/**
 * Loop for displaying most popular ads
 *
 * @package ClassiPress
 * @author AppThemes
 *
 */
global $pageposts;
$pageposts = cp_get_popular_ads();
?>

<?php 
appthemes_before_loop();
?>

<?php 
if ($pageposts) {
    ?>

    <?php 
    foreach ($pageposts as $post) {
        ?>

      <?php 
        setup_postdata($post);
        ?>

      <?php 
        appthemes_before_post();
/**
 * Loop for displaying most popular ads
 *
 * @package ClassiPress
 * @author AppThemes
 *
 */
global $cp_options;
?>

<?php 
appthemes_before_loop();
?>

<?php 
if ($query = cp_get_popular_ads()) {
    ?>

	<?php 
    while ($query->have_posts()) {
        $query->the_post();
        ?>

		<?php 
        appthemes_before_post();
        ?>

		<div class="post-block-out <?php 
        cp_display_style('featured');
        ?>
">