Skip to content

Commit

Permalink
Show categories on top of post list view (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Aug 1, 2024
1 parent 05703ea commit 1c51989
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
11 changes: 11 additions & 0 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
?>
</header><!-- .page-header -->

<?php
$sunflower_parsed_blocks = parse_blocks( '<!-- wp:categories /-->' );
if ( $sunflower_parsed_blocks ) {
echo '<div class="filter-button-group mb-5 text-center">';
foreach ( $sunflower_parsed_blocks as $sunflower_block ) {
echo wp_kses_post( render_block( $sunflower_block ) );
}
echo '</div>';
}
?>

<?php
/* Start the Loop */
$sunflower_list_items = '';
Expand Down
44 changes: 44 additions & 0 deletions sass/_archives.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,48 @@
}
}
}

ul.wp-block-categories-list {
display: inline-flex;
list-style-type: none;

li {

a {

@include themed() {
font-family: t("standardFont");
}

font-weight: 700;
font-size: 16px;
color: $black;
letter-spacing: 0.05em;
background: none;
border: 0;
padding: 0;
margin: 0 1em;
border-bottom: 2px solid transparent;
text-transform: uppercase;

&:focus {
outline: none;
box-shadow: none;
}

&:hover,
&:focus,
&:active {
color: $primary;
border-bottom-color: $primary;
}

}

&.current-cat {
border-bottom: 2px solid $black;

}
}
}
}

0 comments on commit 1c51989

Please sign in to comment.