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

    r18253 r18291  
    1313            <div id="content" role="main">
    1414
     15            <?php if ( have_posts() ) : ?>
     16
    1517                <?php
    1618                    /* Queue the first post, that way we know
     
    2022                     * properly with a call to rewind_posts().
    2123                     */
    22                     if ( have_posts() )
    23                         the_post();
     24                    the_post();
    2425                ?>
    2526
     
    6768                <?php twentyeleven_content_nav( 'nav-below' ); ?>
    6869
     70            <?php else : ?>
     71
     72                <article id="post-0" class="post no-results not-found">
     73                    <header class="entry-header">
     74                        <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
     75                    </header><!-- .entry-header -->
     76
     77                    <div class="entry-content">
     78                        <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
     79                        <?php get_search_form(); ?>
     80                    </div><!-- .entry-content -->
     81                </article><!-- #post-0 -->
     82
     83            <?php endif; ?>
     84
    6985            </div><!-- #content -->
    7086        </section><!-- #primary -->
Note: See TracChangeset for help on using the changeset viewer.