Entry Meta Style
-
Hello, I have used the code from “example two” of your page:
https://docs.generatepress.com/article/entry-meta-style/#example-1
My question is… How could I edit the code to remove everything and show only the name and date. (Not counting the avatar)
And before the date and name, show the clock icon and the user icon.
I have another question, I don’t know if it goes here I hope, but how could I hide the categories and category navigation in the posts and only show tags?
Thanks so much!
-
This topic was modified 5 years, 4 months ago by
link1921u.
The page I need help with: [log in to see the link]
-
This topic was modified 5 years, 4 months ago by
-
Hi there,
To remove the categories from the example, remove this part of the code:
in <?php generate_do_post_meta_item( 'categories' ); ?>Just to confirm, you want a user icon as well as the avatar? Do you have anything on your site that’s using an icon library, like Font Awesome?
To remove categories from the footer meta, try this:
add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array_diff( $items, array( 'categories' ) ); } );Just to confirm, you want a user icon as well as the avatar? Do you have anything on your site that’s using an icon library, like Font Awesome?
– Yes, I have Font Awesome, and thanks for the codes, I am a beginner and I feel overwhelmed
I have already managed to show the labels, so I only need the icons and, if you can, help me remove the “Por” that appears next to the name, and put the date next to the name, as normal
This is my idea:
I’m sorry if I ask a lot, really, but I’ve been with this for days
-
This reply was modified 5 years, 4 months ago by
link1921u.
My idea:
(I dont know why my link is not visible)
-
This reply was modified 5 years, 4 months ago by
link1921u.
To add the icons and remove the “by” text, try this:
add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) { if ( 'date' === $item ) { $output = '<i class="far fa-clock"></i> '; } if ( 'author' === $item ) { $output = '<i class="fas fa-user"></i> '; } return $output; }, 50, 2 );Of course, you can adjust the icons to whatever you like 🙂
Tom … I’ll be honest, I love you so much hahaha
hahah I’m glad I could help! 🙂
-
This reply was modified 5 years, 4 months ago by
The topic ‘Entry Meta Style’ is closed to new replies.
