- This topic has 9 replies, 3 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
September 23, 2019 at 1:51 am #1016367
Rovanov
Hi Generate!
Is it possible to place the” Display post categories ” at the top of the single post directly under post author / post date, and not at the end of the post?They’re bad to find there, even under the related post with me.
https://wakkermens.info/van-bolsjewisme-naar-bureaucratie/Thank you for answering,
greetings
RovanovSeptember 23, 2019 at 2:56 am #1016416David
StaffCustomer SupportHi there,
you can use the Post Meta filter to include them in the Entry Meta:
https://docs.generatepress.com/article/generate_header_entry_meta_items/
You filter would look something like this:
add_filter( 'generate_header_entry_meta_items', function( $items ) { if ( is_single() ) { $items = array( 'date', 'author', 'categories', ); } return $items; } );
If that works we can assist with some CSS to display the categories below the date and author.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 24, 2019 at 2:12 pm #1018076Rovanov
Thank you for the quick answer!
Sorry, I’m a beginner.
In what file should I put this in?
Don’t worry, I can try it on my local host. 🙂Thanks,
RovanovSeptember 24, 2019 at 4:47 pm #1018157Tom
Lead DeveloperLead DeveloperHi there,
That code can be added using one of these methods: https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 27, 2019 at 1:49 am #1020210Rovanov
Thank you!
September 27, 2019 at 9:01 am #1020591David
StaffCustomer SupportGlad we could be of help
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 1, 2019 at 2:33 am #1023125Rovanov
Hello support team!
Okay, that works great, but this way is not very beautiful.
Now I want more. 🙂
(Of course, I am willing to pay for such a personal adjustment.)How do I get the categories with map-icon above the date and author in a single post?
Thanks & greetings!
RovanovOctober 1, 2019 at 6:33 am #1023288David
StaffCustomer SupportHi there,
so instead of the code provided above, add this:
add_filter( 'generate_category_list_output','lh_remove_categories' ); function lh_remove_categories( $categories ) { if ( is_single() ) { return ''; } } add_action( 'generate_after_entry_title','lh_single_cats_above_title' ); function lh_single_cats_above_title() { $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); if ( $categories_list && is_single() ) { printf( '<span class="entry-meta cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x( 'Categories', 'Used before category names.', 'generatepress' ), $categories_list ); } }
Then add this CSS to include a dashicon before it:
.entry-meta.cat-links:before { content: "\f231"; font-family: "dashicons"; display: inline; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 1, 2019 at 6:59 am #1023304Rovanov
Yes!!!!!!!!
Great, wonderful, genius!
I love you!
When are we gonna have a beer? (Amsterdam?)I’ve change the following.:
content: “\f231”; to: content: “\f07b”;
and
font-family: “dashicons” to: font-family: “GeneratePress”;Thank you very much!
October 1, 2019 at 8:51 am #1023495David
StaffCustomer SupportGlad to be of help 🙂
Feel free to buy some coffees:
https://generatepress.com/ongoing-development/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.