0
我想知道是否有办法让某个div显示:没有帖子时没有。如果没有内容,让div消失
这就是我想出迄今:
<div class="MVP-box">
<?php
$loop = new WP_Query(array('post_type' => 'MVP', 'posts_per_page' => 1));
?>
<?php while ($loop->have_posts()) : $loop->the_post(); ?>
<?php
$custom = get_post_custom($post->ID);
$screenshot_url = $custom["screenshot_url"][0];
$website_url = $custom["website_url"][0];
?>
<div class="post-entry">
<div class="MVP-title">
<?php the_title(); ?>
</div>
<div class="MVP-thumbnail">
<?php the_post_thumbnail('MVP-picture'); ?>
</div>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</div>
我想知道的是,如果有一种方法,使MVP框格消失时,有没有文章内容。有任何想法吗?
对,对。我没有想到这一点。谢谢:D – BMS 2013-02-28 00:21:41