• Hi, I’m trying to create a custom template for a page that shows posts in a specific category, but can’t get the default ‘Sorry, no content found’ message to work when there’s no posts.

    Here’s my code:

    <?php
    /*
    Template Name: Events in December
    */
    ?>
    <?php get_header(); ?>
    
    	<div id="dates">
        <ul>
        <?php wp_list_pages('title_li=&child_of=16'); ?>
        <ul>
        </ul>
        </div>
    
    	<div id="body_area">
    
    		<div id="text_left">
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<div class="entry">
    
    <ul class="activities">
    <?php query_posts('category_name=december&showposts=0'); ?>
    <?php while (have_posts()) : the_post(); ?>
            <li><a href="<?php the_permalink(); ?>">
              <h1><?php the_title(); ?></h1>
              <h2><?php the_excerpt_rss(); ?></h2>
              </a></li>
            <?php endwhile; ?>
    </ul>
    			</div>
    		</div>
    	</div>
        <div id="text_right"><?php get_sidebar(); ?></div>
    	</div>
    <?php get_footer(); ?>

    Any suggestions?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘‘if while else’ conditional content help required’ is closed to new replies.