where do you want to show the categories?
below the title, below the excerpt?
same as in single post view?
same formatting? different formatting?
are you already using a child theme?
generally, the code to show the post is done via /template-parts/post/content.php (unless you are using post formats).
and the section to show the category is done (conditionalyy for single posts only):
<?php if ( is_single() ) : ?>
<?php twentyseventeen_entry_footer(); ?>
<?php endif; ?>
remove the condition, and the categories will also show in the posts page.
-
This reply was modified 6 years ago by
Michael.
Thank you Michael!
where do you want to show the categories?
below the title, below the excerpt?
same as in single post view?
same formatting? different formatting?
the best solution for me will be the same line of the date, same format of the date
are you already using a child theme?
good question… I messed up a lot. In a first time I used one, actually I think I’m not using it
one way of doing it, would be to edit content.php in /template-parts/post/ (in a child theme or not) and replace this section:
echo '<div class="entry-meta">';
if ( is_single() ) {
twentyseventeen_posted_on();
} else {
echo twentyseventeen_time_link();
twentyseventeen_edit_link();
};
echo '</div><!-- .entry-meta -->';
with:
echo '<div class="entry-meta">';
twentyseventeen_posted_on();
if( is_home() ) :
//categories output//
/* translators: used between list items, there is a space after the comma */
$separate_meta = __( ', ', 'twentyseventeen' );
// Get Categories for posts.
$categories_list = get_the_category_list( $separate_meta );
if ( ( $categories_list && twentyseventeen_categorized_blog() ) ) {
echo ' /<span class="cat-tags-links"> ';
// Make sure there's more than one category before displaying.
echo '<span class="cat-links">' . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>';
echo '</span>';
}
twentyseventeen_edit_link();
endif;
echo '</div><!-- .entry-meta -->';
Sorry but it does not work