forked from mirror/_s
_s: Simplifying search, index, and archive, with a common no posts found template part, no-results.php; Closes #1187
git-svn-id: https://wpcom-themes.svn.automattic.com/_s/@9340 d957f892-c61d-0410-b221-f235e6eecf30
This commit is contained in:
parent
49f37d5920
commit
7b04baa743
11
archive.php
11
archive.php
|
@ -88,16 +88,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<article id="post-0" class="post no-results not-found">
|
<?php get_template_part( 'no-results', 'archive' ); ?>
|
||||||
<header class="entry-header">
|
|
||||||
<h1 class="entry-title"><?php _e( 'Nothing Found', '_s' ); ?></h1>
|
|
||||||
</header><!-- .entry-header -->
|
|
||||||
|
|
||||||
<div class="entry-content">
|
|
||||||
<p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', '_s' ); ?></p>
|
|
||||||
<?php get_search_form(); ?>
|
|
||||||
</div><!-- .entry-content -->
|
|
||||||
</article><!-- #post-0 -->
|
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
10
index.php
10
index.php
|
@ -38,15 +38,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php elseif ( current_user_can( 'edit_posts' ) ) : ?>
|
<?php elseif ( current_user_can( 'edit_posts' ) ) : ?>
|
||||||
|
|
||||||
<article id="post-0" class="post no-results not-found">
|
<?php get_template_part( 'no-results', 'index' ); ?>
|
||||||
<header class="entry-header">
|
|
||||||
<h1 class="entry-title"><?php _e( 'No posts to display', '_s' ); ?></h1>
|
|
||||||
</header><!-- .entry-header -->
|
|
||||||
|
|
||||||
<div class="entry-content">
|
|
||||||
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', '_s' ), admin_url( 'post-new.php' ) ); ?></p>
|
|
||||||
</div><!-- .entry-content -->
|
|
||||||
</article><!-- #post-0 -->
|
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* The template part for displaying a message that posts cannot be found.
|
||||||
|
*
|
||||||
|
* Learn more: http://codex.wordpress.org/Template_Hierarchy
|
||||||
|
*
|
||||||
|
* @package _s
|
||||||
|
* @since _s 1.0
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article id="post-0" class="post no-results not-found">
|
||||||
|
<header class="entry-header">
|
||||||
|
<h1 class="entry-title"><?php _e( 'Nothing Found', '_s' ); ?></h1>
|
||||||
|
</header><!-- .entry-header -->
|
||||||
|
|
||||||
|
<div class="entry-content">
|
||||||
|
<?php if ( is_home() ) { ?>
|
||||||
|
|
||||||
|
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', '_s' ), admin_url( 'post-new.php' ) ); ?></p>
|
||||||
|
|
||||||
|
<?php } elseif ( is_search() ) { ?>
|
||||||
|
|
||||||
|
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', '_s' ); ?></p>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
|
<?php } else { ?>
|
||||||
|
|
||||||
|
<p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', '_s' ); ?></p>
|
||||||
|
<?php get_search_form(); ?>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</div><!-- .entry-content -->
|
||||||
|
</article><!-- #post-0 -->
|
11
search.php
11
search.php
|
@ -30,16 +30,7 @@ get_header(); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
|
||||||
<article id="post-0" class="post no-results not-found">
|
<?php get_template_part( 'no-results', 'search' ); ?>
|
||||||
<header class="entry-header">
|
|
||||||
<h1 class="entry-title"><?php _e( 'Nothing Found', '_s' ); ?></h1>
|
|
||||||
</header><!-- .entry-header -->
|
|
||||||
|
|
||||||
<div class="entry-content">
|
|
||||||
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', '_s' ); ?></p>
|
|
||||||
<?php get_search_form(); ?>
|
|
||||||
</div><!-- .entry-content -->
|
|
||||||
</article><!-- #post-0 -->
|
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
Reference in New Issue