Hi,
On the Merch theme, under the Single Post Entry Header element, the following code is being run. Is there a way to add a class to the post categories which shows up above the title? I want to be able to add margins and stylize it.
<div id="custom-post-entry-header" class="custom-post-header grid-container">
<?php
$categories = get_the_category();
$separator = ' | ';
$output = '';
if ( ! empty( $categories ) ) {
foreach( $categories as $category ) {
$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator;
}
echo trim( $output, $separator );
}
the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
if ( has_excerpt() ) : // Only show custom excerpts not autoexcerpts ?>
<p class="entry-subtitle"><?php echo get_the_excerpt(); ?></p>
<?php endif; ?>
</div>