Archived topic
Move post-meta above title
20 replies · Started by LoGP on December 26, 2017
Hello,
Continuing from this topic:
https://generatepress.com/forums/topic/change-position-of-meta-information-on-home-page/
1) How do I move the post-meta information above my title on the blog page? (I've tried your solution to use before_entry but that moves the post-meta above my thumbnail, see my website).
2) How do I remove the category font awesome icon?
Cheers
L
Hi there,
1) What about adding this CSS:
.entry-meta {
padding-left: 233px;
}
2) Try this:
.cat-links:before {
display: none;
}
1) This moves the post-meta above the title, but also above the thumbnail. The post-meta should align with on the same height as the thumbnail. Also on mobile it doesn't look right.
2) Works thanks.
Cheers
L
Hmm there should be a generate_before_entry_title hook. Tom used it here: https://generatepress.com/forums/topic/blog-category-above-title/#post-316793
But you've tried it and didn't work?
Hey Leo,
Yup, tried it but didn't work.
This is the snippet I use:
add_action( 'after_setup_theme', 'tu_move_footer_entry_meta' );
function tu_move_footer_entry_meta() {
if ( ! is_singular() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
add_action( 'generate_before_entry_title', 'generate_footer_meta' );
}
}
Do you only want that on the main blog page?
If so give this a shot:
add_action( ‘after_setup_theme’, ‘tu_move_footer_entry_meta’ );
function tu_move_footer_entry_meta() {
if ( is_home() ) {
remove_action( ‘generate_after_entry_content’, ‘generate_footer_meta’ );
add_action( ‘generate_before_entry_title’, ‘generate_footer_meta’ );
}
}
Having the same issue, if putting conditional tag and hook 'after_setup_theme' it doesn't work. But without conditional tag it works.
Try change 'after_setup_theme' to 'wp' if using conditional tag and it works for me.
Awesome :)
@Leo, the code you provided also didn't do it.
@Akhmed, sorry I don't really understand. What do I have to do exactly?
Thanks
L
Try this:
add_action( 'wp', 'tu_move_footer_entry_meta' );
function tu_move_footer_entry_meta() {
if ( is_home() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
add_action( 'generate_before_entry_title', 'generate_footer_meta' );
}
}
Now the category shows up below my excerpt?
Hmm that's not what that code should do.
Without the code above, where does the category show up? The same place?
Hey,
I removed the code. The category indeed shows up in the same place.
Cheers
L
Can you try the updated code above?: https://generatepress.com/forums/topic/move-post-meta-above-title/#post-458835
Hey Leo,
Already tried that code. Tried it again. Still doesn't work.
I started playing around and found something weird.
The category shows up in the correct place (above the title) when I also activate the Post Date in Layout > Blog > Archive. When I uncheck Post Date, the Post Category also disappears.
I could check both Post Date and Post Category and then hide the Post Date with CSS. But that seems like an improper work-around. Because in my case the post date should be removed. Not hidden.
What can I do next?
Cheers
L
PS. The more I work with GP, the more I like it. I'm coming from Genesis, which I still really like. I feel that if you keep adding more customization options in GP, it can become big...
PPS. You should integrate your WP Show Posts plugin with GP :)