Make WordPress Core


Ignore:
Timestamp:
06/12/2011 05:43:03 PM (14 years ago)
Author:
ryan
Message:

Add no posts found message to templates. Props sorich87. fixes #17735

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/category.php

    r18058 r18291  
    1212        <section id="primary">
    1313            <div id="content" role="main">
     14
     15            <?php if ( have_posts() ) : ?>
    1416
    1517                <header class="page-header">
     
    4244                <?php twentyeleven_content_nav( 'nav-below' ); ?>
    4345
     46            <?php else : ?>
     47
     48                <article id="post-0" class="post no-results not-found">
     49                    <header class="entry-header">
     50                        <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
     51                    </header><!-- .entry-header -->
     52
     53                    <div class="entry-content">
     54                        <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
     55                        <?php get_search_form(); ?>
     56                    </div><!-- .entry-content -->
     57                </article><!-- #post-0 -->
     58
     59            <?php endif; ?>
     60
    4461            </div><!-- #content -->
    4562        </section><!-- #primary -->
Note: See TracChangeset for help on using the changeset viewer.