Bootcamp II is a wordpress theme (as well as an inside joke) designed to suit the needs of foothillschurch.com. It makes use of webpack, Babel, Sass, Tailwind, Browsersync, PostCSS, ESLint, Stylelint, Prettier and more. It is meant for that site, but if you can use it by all means go for it.
In the following code you don't check that $term is null before using it, like $term->term_id. PHP would throw an error if you tried to access a property of null like that.
What I would suggest is to declare that variable once, and handle null as needed throughout the layout. Something like this for example.
...
get_header();
// Get the current taxonomy term
$term = get_queried_object();
?>
<div class="bg-salty-gradient">
<div class="...">
<div class="content-middle text-center">
<h1 class="text-white text-3xl md:text-5xl font-bold uppercase">
<?php echo $term === null ? "Unknown Series" : "Series: " . esc_html($term->name); ?>
</h1>
</div>
</div>
</div>
<div class="bg-white-gradient">
<div class="md:w-8/12 mx-auto grid grid-cols-12 p-5 gap-4">
<?php if ($term === null): ?>
<p>Something has gone terribly wrong, and we don't recognize this series. Etc...</p>
<?php else:
// WP_Query arguments
$args = array(...);
...
<?php endif; ?>
...
And while we're at it, the echo 'there are no posts.'; // no posts found isn't great... maybe make it a little more presentable for the user with a better message? This is just a UX suggestion.
In the following code you don't check that
$term
isnull
before using it, like$term->term_id
. PHP would throw an error if you tried to access a property ofnull
like that.https://github.com/Myzwer/foothillschurch/blob/effc5bbf81497ae99f0561ab7849412fe9272bfd/taxonomy-series.php#L41-L57
Earlier in the file, you already declare this variable in the same way, and check if it's null. https://github.com/Myzwer/foothillschurch/blob/effc5bbf81497ae99f0561ab7849412fe9272bfd/taxonomy-series.php#L23-L29
What I would suggest is to declare that variable once, and handle null as needed throughout the layout. Something like this for example.
And while we're at it, the
echo 'there are no posts.'; // no posts found
isn't great... maybe make it a little more presentable for the user with a better message? This is just a UX suggestion.