Make WordPress Core


Ignore:
Timestamp:
06/12/2011 05:43:03 PM (15 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/archive.php

    r18253 r18291  
    1717                <section id="primary">
    1818                        <div id="content" role="main">
     19
     20                        <?php if ( have_posts() ) : ?>
    1921
    2022                                <header class="page-header">
    … …  
    4951                                <?php twentyeleven_content_nav( 'nav-below' ); ?>
    5052
     53                        <?php else : ?>
     54
     55                                <article id="post-0" class="post no-results not-found">
     56                                        <header class="entry-header">
     57                                                <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
     58                                        </header><!-- .entry-header -->
     59
     60                                        <div class="entry-content">
     61                                                <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
     62                                                <?php get_search_form(); ?>
     63                                        </div><!-- .entry-content -->
     64                                </article><!-- #post-0 -->
     65
     66                        <?php endif; ?>
     67
    5168                        </div><!-- #content -->
    5269                </section><!-- #primary -->
Note: See TracChangeset for help on using the changeset viewer.