Init
This commit is contained in:
76
theme/template-parts/content/content-none.php
Normal file
76
theme/template-parts/content/content-none.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Template part for displaying a message when posts are not found
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||
*
|
||||
* @package studio-up
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<section>
|
||||
|
||||
<header class="page-header">
|
||||
<?php if ( is_search() ) : ?>
|
||||
|
||||
<h1 class="page-title">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: search result title. 2: search term. */
|
||||
'<h1 class="page-title">%1$s <span>%2$s</span></h1>',
|
||||
esc_html__( 'Search results for:', 'studio-up' ),
|
||||
get_search_query()
|
||||
);
|
||||
?>
|
||||
</h1>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'studio-up' ); ?></h1>
|
||||
|
||||
<?php endif; ?>
|
||||
</header><!-- .page-header -->
|
||||
|
||||
<div <?php studio_up_content_class( 'page-content' ); ?>>
|
||||
<?php
|
||||
if ( is_home() && current_user_can( 'publish_posts' ) ) :
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Your site is set to show the most recent posts on your homepage, but you haven’t published any posts.', 'studio-up' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo esc_url( admin_url( 'edit.php' ) ); ?>">
|
||||
<?php
|
||||
/* translators: 1: link to WP admin new post page. */
|
||||
esc_html_e( 'Add or publish posts', 'studio-up' );
|
||||
?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
elseif ( is_search() ) :
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Your search generated no results. Please try a different search.', 'studio-up' ); ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
get_search_form();
|
||||
else :
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'No content matched your request.', 'studio-up' ); ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
get_search_form();
|
||||
endif;
|
||||
?>
|
||||
</div><!-- .page-content -->
|
||||
|
||||
</section>
|
||||
Reference in New Issue
Block a user