- Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/html/dev/wp/wp-includes/formatting.php on line 4371Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/html/dev/wp/wp-includes/formatting.php on line 4371Notice: Trying to get property 'comment_author_email' of non-object in /var/html/dev/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 236
SpaceGhost79
ParticipantWarning: Cannot modify header information - headers already sent by (output started at /var/html/dev/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /var/html/dev/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Is there a way (code) to make it so if you don’t have any posts for a particular section on your main page, the box won’t show up and jump bump up the stuff below it?
For instance, if you scroll down a little bit to the “Laughing Whitefish” section I have. This section displays the latest post in the category named “Books.” If I remove the post, so there are no posts in that category, that section would still display “No entries found. There are no entries in this blog,” in its place. Is there a way to make it so if there no posts in that category the whole section wouldn’t appear and whatever’s below it (in this case the Program Highlights section) would just move up below the news section? Here’s the code right now…
[code] <div id=”latest”>
<h3><?php _e(‘Laughing Whitefish’,’cover-wp’) ?></h3>
<?php query_posts(“caller_get_posts=1&showposts=3&category_name=”.get_option(‘cover_wp_photos_cat’, ‘Books’)); $i = 1; ?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class=”the_content”>
<?php the_content(‘Read entire article »’); ?>
</div><!– /the_content –>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php else: ?>
<h2 class=”center”><?php _e(‘No Entries Found’,’cover-wp’) ?></h2>
<p class=”center”><?php _e(‘There are no entries in this blog.’,’cover-wp’) ?></p>
<?php endif; ?>
</div>[/code]
You must be logged in to reply to this topic.