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/index.php

    r17959 r18291  
    1818            <div id="content" role="main">
    1919
     20            <?php if ( have_posts() ) : ?>
     21
    2022                <?php twentyeleven_content_nav( 'nav-above' ); ?>
    2123
     
    2931                <?php twentyeleven_content_nav( 'nav-below' ); ?>
    3032
     33            <?php else : ?>
     34
     35                <article id="post-0" class="post no-results not-found">
     36                    <header class="entry-header">
     37                        <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
     38                    </header><!-- .entry-header -->
     39
     40                    <div class="entry-content">
     41                        <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
     42                        <?php get_search_form(); ?>
     43                    </div><!-- .entry-content -->
     44                </article><!-- #post-0 -->
     45
     46            <?php endif; ?>
     47
    3148            </div><!-- #content -->
    3249        </div><!-- #primary -->
Note: See TracChangeset for help on using the changeset viewer.