I've made a child theme of Twenty Twenty theme and want to display the posts/ category archive pages in flexbox grid.
However, none of the conditional tags I'm hoping to check outside the loop (is_home, is_archive, is_category) are returning true on posts page or category archive pages:
* @since Twenty Twenty 1.0
*/
get_header();
?>
<?php if ( is_archive() ): ?>
<h1>ARCHIVE</h1>
<?php endif; ?>
<?php if ( is_category() ): ?>
<h1>CATEGORY</h1>
<?php endif; ?>
<?php if ( is_home() ): ?>
<h1>HOME</h1>
<?php endif; ?>
<main id="site-content maybe-flex-directive-class-here">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
I expect either I'm missing something obvious or going about it the wrong way.
singular.php
<main id="site-content">
onindex.php
as well assingular.php
. I think I will delete this post unless you feel like posting an answer. Please lmk.