- This topic has 5 replies, 2 voices, and was last updated 3 years, 3 months ago by
Leo.
-
AuthorPosts
-
October 2, 2019 at 7:40 am #1024269
Slawomir
Hi,
How can I show multiple meta-data in a single line under the title?
e.g.
Titel XXX
28. September 2019 | 0 Comments | Tags: Tag1, Tag2, Tag3Greeting
SlawomirOctober 2, 2019 at 9:28 am #1024496Leo
StaffCustomer SupportHi there,
Would that be for the posts page and single posts?
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 3, 2019 at 10:21 am #1025496Slawomir
Hello,
YES, for both.
October 3, 2019 at 5:28 pm #1025748Leo
StaffCustomer SupportCan you add this PHP snippet first and link me to the page in question?
add_filter( 'generate_post_date_output', function( $output ) { echo $output; if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo '<span class="comments-link">'; comments_popup_link( __( '0 comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); echo '</span>'; } $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); $tags_list = sprintf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x( 'Tags', 'Used before tag names.', 'generatepress' ), $tags_list ); echo $tags_list; } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 6, 2019 at 3:49 am #1027432Slawomir
Hello Leo,
Thank you for your great support. I understood a lot now. It works very well.
I have slightly adapted the version yet:/* Header – posts */
add_filter( ‘generate_header_entry_meta_items’, function() {
return array(
‘date’,
‘comments-link’,
‘categories’,
‘tags’,
);
} );/* Header – single posts */
add_filter( ‘generate_header_entry_meta_items’, function( $items ) {
if ( is_single() ) {
$items = array(
‘date’,
‘tags’,
);
} return $items;
} );/* Header – add comments-link after post_date for single post*/
add_filter( ‘generate_post_date_output’, function( $output ) {
echo $output;if ( is_single() ) {
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo ‘<span class=”comments-link”>’;
comments_popup_link( __( ‘0 comment’, ‘generatepress’ ), __( ‘1 Comment’, ‘generatepress’ ), __( ‘% Comments’, ‘generatepress’ ) );
echo ‘</span>’;
}
}
} );Greetings
SlawekOctober 6, 2019 at 10:27 am #1027732Leo
StaffCustomer SupportGlad you figured out π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.