Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
January 17, 2025 at 12:58 pm #1475290
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/)
January 20, 2025 at 6:44 am #1475399Hey 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,
IsmaelJanuary 29, 2025 at 9:59 am #1475967Thanks, exactly what i was looking for!
January 29, 2025 at 1:42 pm #1475972 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
