Hi,
can ich add “blog-categories minor-meta” to the Masonry Blog layout somehow? Like you can see it in all the Author Blog layouts. (https://kriesi.at/themes/enfold/blog/blog-single-author-big/)
Hey FW,
Thank you for the inquiry.
You can add the following filter to the functions.php file to display the date, author, and categories, but please note that they will not be accessible or will not be displayed as links.
add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_cat', 10, 2 );
function avf_masonry_loop_prepare_mod_cat( $key, $entries ) {
$categories = get_the_category($key['ID']);
$separator = ' ';
$output = '
<div class="masonry-cat">';
if ( ! empty( $categories ) ) {
foreach( $categories as $category ) {
$output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator;
}
}
$output .= '</div>';
$post_date = get_the_date( '', $key['ID'] );
$output .= '<div class="masonry-date">' . $post_date . '</div>';
$author_id = $key['post_author'];
$author_name = get_the_author_meta( 'display_name', $author_id );
$output .= '<div class="masonry-author">' . $author_name . '</div>';
$key['text_after'] .= trim( $output, $separator );
return $key;
}
Best regards,
Ismael
Thanks, exactly what i was looking for!