Archived topic
Excluding meta on posts pages but not on single post pages.
4 replies · Started by Andrew on May 11, 2017
Excluding meta (Date, Author, etc) on latest posts pages and category pages but not on single post pages.
Is this possible? Maybe I should edit the relevant php file and use a child theme?
Hi Andrew,
Give this CSS a shot:
.blog .entry-meta,
.archive .entry-meta,
.category .entry-meta {
display: none;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know.
If you'd like to remove them completely (not just hide them), try this:
add_action( 'wp','tu_remove_meta_on_index' );
function tu_remove_meta_on_index() {
if ( ! is_single() ) {
remove_action( 'generate_after_entry_title', 'generate_post_meta' );
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
}
}
OK, great, the CSS works - should have guessed that. Hiding is good enough but thanks for the functions snippet.
And great theme by the way.
Thanks Tom :)
Glad we could help!