Skip to content

Commit

Permalink
It's Overridin' Time (plus Alert System)
Browse files Browse the repository at this point in the history
Overriding parent theme files.

Bottom text.
  • Loading branch information
davidagnome committed Oct 8, 2022
1 parent 1761e94 commit fe1b9cc
Show file tree
Hide file tree
Showing 47 changed files with 2,115 additions and 12 deletions.
90 changes: 90 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package Understrap
*/

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();

$container = get_theme_mod( 'understrap_container_type' );
?>

<div class="wrapper" id="error-404-wrapper">

<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

<div class="row">

<div class="col-md-12 content-area" id="primary">

<main class="site-main" id="main">

<section class="error-404 not-found">

<header class="page-header">

<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'understrap' ); ?></h1>

</header><!-- .page-header -->

<div class="page-content">

<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'understrap' ); ?></p>

<?php get_search_form(); ?>

<?php the_widget( 'WP_Widget_Recent_Posts' ); ?>

<?php if ( understrap_categorized_blog() ) : // Only show the widget if site has multiple categories. ?>

<div class="widget widget_categories">

<h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', 'understrap' ); ?></h2>

<ul>
<?php
wp_list_categories(
array(
'orderby' => 'count',
'order' => 'DESC',
'show_count' => 1,
'title_li' => '',
'number' => 10,
)
);
?>
</ul>

</div><!-- .widget -->

<?php endif; ?>

<?php

/* translators: %1$s: smiley */
$archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'understrap' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );

the_widget( 'WP_Widget_Tag_Cloud' );
?>

</div><!-- .page-content -->

</section><!-- .error-404 -->

</main><!-- #main -->

</div><!-- #primary -->

</div><!-- .row -->

</div><!-- #content -->

</div><!-- #error-404-wrapper -->

<?php
get_footer();
71 changes: 71 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/**
* The template for displaying archive pages
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Understrap
*/

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();

$container = get_theme_mod( 'understrap_container_type' );
?>

<div class="wrapper" id="archive-wrapper">

<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

<div class="row">

<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check' ); ?>

<main class="site-main" id="main">

<?php
if ( have_posts() ) {
?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
<?php
// Start the loop.
while ( have_posts() ) {
the_post();

/*
* Include the Post-Format-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 Format name) and that will be used instead.
*/
get_template_part( 'loop-templates/content', get_post_format() );
}
} else {
get_template_part( 'loop-templates/content', 'none' );
}
?>

</main><!-- #main -->

<?php
// Display the pagination component.
understrap_pagination();
// Do the right sidebar check.
get_template_part( 'global-templates/right-sidebar-check' );
?>

</div><!-- .row -->

</div><!-- #content -->

</div><!-- #archive-wrapper -->

<?php
get_footer();
113 changes: 113 additions & 0 deletions author.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php
/**
* The template for displaying the author pages
*
* Learn more: https://codex.wordpress.org/Author_Templates
*
* @package Understrap
*/

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();
$container = get_theme_mod( 'understrap_container_type' );
?>

<div class="wrapper" id="author-wrapper">

<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

<div class="row">

<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check' ); ?>

<main class="site-main" id="main">

<header class="page-header author-header">

<?php
if ( get_query_var( 'author_name' ) ) {
$curauth = get_user_by( 'slug', get_query_var( 'author_name' ) );
} else {
$curauth = get_userdata( intval( $author ) );
}

the_archive_title( '<h1 class="page-title">', '</h1>' );

if ( ! empty( $curauth->ID ) ) {
$alt = sprintf(
/* translators: %s: author name */
_x( 'Profile picture of %s', 'Avatar alt', 'understrap' ),
$curauth->display_name
);
echo get_avatar( $curauth->ID, 96, '', $alt );
}

if ( ! empty( $curauth->user_url ) || ! empty( $curauth->user_description ) ) {
?>
<dl>
<?php if ( ! empty( $curauth->user_url ) ) : ?>
<dt><?php esc_html_e( 'Website', 'understrap' ); ?></dt>
<dd>
<a href="<?php echo esc_url( $curauth->user_url ); ?>"><?php echo esc_html( $curauth->user_url ); ?></a>
</dd>
<?php endif; ?>

<?php if ( ! empty( $curauth->user_description ) ) : ?>
<dt>
<?php
printf(
/* translators: %s: author name */
esc_html__( 'About %s', 'understrap' ),
$curauth->display_name
);
?>
</dt>
<dd><?php echo esc_html( $curauth->user_description ); ?></dd>
<?php endif; ?>
</dl>
<?php
}

if ( have_posts() ) {
printf(
/* translators: %s: author name */
'<h2>' . esc_html__( 'Posts by %s', 'understrap' ) . '</h2>',
$curauth->display_name
);
}
?>

</header><!-- .page-header -->

<!-- The Loop -->
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_template_part( 'loop-templates/content', 'author' );
}
} else {
get_template_part( 'loop-templates/content', 'none' );
}
?>
<!-- End Loop -->

</main><!-- #main -->

<!-- The pagination component -->
<?php understrap_pagination(); ?>

<!-- Do the right sidebar check -->
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>

</div> <!-- .row -->

</div><!-- #content -->

</div><!-- #author-wrapper -->

<?php
get_footer();
80 changes: 80 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
/**
* The template for displaying comments
*
* The area of the page that contains both current comments
* and the comment form.
*
* @package Understrap
*/

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

/*
* If the current post is protected by a password and the visitor has not yet
* entered the password we will return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>

<div class="comments-area" id="comments">

<?php // You can start editing here -- including this comment! ?>

<?php if ( have_comments() ) : ?>

<h2 class="comments-title">

<?php
$comments_number = get_comments_number();
if ( 1 === (int) $comments_number ) {
printf(
/* translators: %s: post title */
esc_html_x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'understrap' ),
'<span>' . get_the_title() . '</span>'
);
} else {
printf(
esc_html(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s thought on &ldquo;%2$s&rdquo;',
'%1$s thoughts on &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'understrap'
)
),
number_format_i18n( $comments_number ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'<span>' . get_the_title() . '</span>'
);
}
?>

</h2><!-- .comments-title -->

<?php understrap_comment_navigation( 'comment-nav-above' ); ?>

<ol class="comment-list">

<?php
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
)
);
?>

</ol><!-- .comment-list -->

<?php understrap_comment_navigation( 'comment-nav-below' ); ?>

<?php endif; // End of if have_comments(). ?>

<?php comment_form(); // Render comments form. ?>

</div><!-- #comments -->
16 changes: 16 additions & 0 deletions css/child-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/child-theme.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/child-theme.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/child-theme.min.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit fe1b9cc

Please sign in to comment.