这段代码loop-ad_listing.php
使所有帖子结果都显示在列表中。但现在我想将特色帖子放在非特色帖子之上(顺序 = 特色,然后是非特色)。我需要在此代码中输入什么代码才能使特色帖子首先出现?
任何帮助表示赞赏:)
<?php if ( have_posts() ) : ?>
<div id="page-<?php echo $paged ?>">
<?php while ( have_posts() ) : the_post(); ?>
<?php
if ( get_post_meta($post->ID, 'location', true) )
$make_address = get_post_meta($post->ID, 'location', true);
else
$make_address = get_post_meta($post->ID, 'cp_street', true) . ' ' . get_post_meta($post->ID, 'cp_city', true) . ' ' . get_post_meta($post->ID, 'cp_state', true) . ' ' . get_post_meta($post->ID, 'cp_zipcode', true);
?>
<div id="post-id-<?php the_ID(); ?>" class="post-wrapper">
<div class="post-block">
<?php if ( is_sticky() ) echo '<strong>FEATURED</strong>'; ?>
<div class="grid_100">
<?php if ( get_option('cp_ad_images') == 'yes' ) cp_ad_loop_thumbnail(); ?>
<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ).'...'; else the_title(); ?></a></h3>
</div>
<div class="post-desc">
<?php echo $make_address; ?>
<div class="post-debug">
<!--<h4>Description:</h4>
<?php echo cp_get_content_preview( 160 ); ?>--!>
</div>
</div>
</div><!-- /post-block -->
</div><!-- /post-wrapper -->
<?php endwhile; ?>
</div><!-- /page -->
<?php else: ?>
<div class="block"><center>Sorry, no results found...</center></div>
<?php endif; ?>