Bump to 1.4.0, made some fixes for 8.2+
This commit is contained in:
91
404.php
91
404.php
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* The template for displaying 404 pages (not found)
|
||||
*
|
||||
* @link https://codex.wordpress.org/Creating_an_Error_404_Pag
|
||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#404-not-found
|
||||
*
|
||||
* @package Sophia After Dark
|
||||
* @since 1.0.0
|
||||
@ -12,53 +12,54 @@ get_header();
|
||||
$sophia_after_dark_pnf_latest_posts = get_theme_mod( 'sophia_after_dark_enable_pnf_latest_posts', true );
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main" role="main" aria-label="<?php esc_attr_e( '404 Error Content', 'sophia-after-dark' ); ?>">
|
||||
|
||||
<section class="error-404 not-found">
|
||||
<div class="error-num"><span><?php esc_html_e( 'Error', 'sophia-after-dark' );?> </span><?php esc_html_e( '404', 'sophia-after-dark' ); ?></div>
|
||||
<header class="page-header">
|
||||
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can’t be found.', 'sophia-after-dark' ); ?></h1>
|
||||
</header>
|
||||
<div class="page-content">
|
||||
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'sophia-after-dark' ); ?></p>
|
||||
</section>
|
||||
|
||||
<?php if ( true === $sophia_after_dark_pnf_latest_posts ) { ?>
|
||||
<div class="page-extra-content mt-404-latest-posts-wrapper">
|
||||
<?php
|
||||
$sophia_after_dark_pnf_latest_post_count = get_theme_mod( 'sophia_after_dark_pnf_latest_post_count', 3 );
|
||||
$sophia_after_dark_pnf_args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => absint( $sophia_after_dark_pnf_latest_post_count ),
|
||||
'ignore_sticky_posts' => 1,
|
||||
);
|
||||
$sophia_after_dark_pnf_query = new WP_Query( $sophia_after_dark_pnf_args );
|
||||
if ( $sophia_after_dark_pnf_query->have_posts() ) {
|
||||
echo '<div class="mt-pnf-latest-posts-wrapper mt-related-posts-wrapper">';
|
||||
$sophia_after_dark_404_latest_title = get_theme_mod( 'sophia_after_dark_pnf_latest_title', __( 'You May Like' ,'sophia-after-dark' ) );
|
||||
echo '<h2 class="section-title mt-related-post-title">'. esc_html( $sophia_after_dark_404_latest_title ) .'</h2>';
|
||||
while ( $sophia_after_dark_pnf_query->have_posts() ) {
|
||||
$sophia_after_dark_pnf_query->the_post();
|
||||
|
||||
/*
|
||||
* Include the Post-Type-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', 'related' );
|
||||
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
<section class="error-404 not-found">
|
||||
<div class="error-num">
|
||||
<span><?php esc_html_e( 'Error', 'sophia-after-dark' ); ?> </span><?php esc_html_e( '404', 'sophia-after-dark' ); ?>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<header class="page-header">
|
||||
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can’t be found.', 'sophia-after-dark' ); ?></h1>
|
||||
</header>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'sophia-after-dark' ); ?></p>
|
||||
</div><!-- .page-content -->
|
||||
</section><!-- .error-404 -->
|
||||
|
||||
<?php if ( true === $sophia_after_dark_pnf_latest_posts ) : ?>
|
||||
<div class="page-extra-content mt-404-latest-posts-wrapper">
|
||||
<?php
|
||||
$sophia_after_dark_pnf_latest_post_count = get_theme_mod( 'sophia_after_dark_pnf_latest_post_count', 3 );
|
||||
$sophia_after_dark_pnf_args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => absint( $sophia_after_dark_pnf_latest_post_count ),
|
||||
'ignore_sticky_posts' => 1,
|
||||
);
|
||||
$sophia_after_dark_pnf_query = new WP_Query( $sophia_after_dark_pnf_args );
|
||||
|
||||
if ( $sophia_after_dark_pnf_query->have_posts() ) :
|
||||
echo '<div class="mt-pnf-latest-posts-wrapper mt-related-posts-wrapper">';
|
||||
$sophia_after_dark_404_latest_title = get_theme_mod( 'sophia_after_dark_pnf_latest_title', __( 'You May Like', 'sophia-after-dark' ) );
|
||||
echo '<h2 class="section-title mt-related-post-title">' . esc_html( $sophia_after_dark_404_latest_title ) . '</h2>';
|
||||
|
||||
while ( $sophia_after_dark_pnf_query->have_posts() ) :
|
||||
$sophia_after_dark_pnf_query->the_post();
|
||||
get_template_part( 'template-parts/content', 'related' );
|
||||
endwhile;
|
||||
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div><!-- .mt-404-latest-posts-wrapper -->
|
||||
<?php endif; ?>
|
||||
|
||||
</main><!-- #main -->
|
||||
</div><!-- #primary -->
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
get_footer();
|
||||
|
Reference in New Issue
Block a user