Archived topic
Two questions about meta data on entries
7 replies · Started by Albert on February 24, 2022
1-I would like to know how I can move the meta tag to the top of the title (https://i.ibb.co/drfZ75P/imagen-categoria.jpg).
I've tried this PHP snippet but it doesn't work:
add_action( 'after_setup_theme', 'your_move_footer_entry_meta' );
function your_move_footer_entry_meta() {
if ( ! is_singular() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
add_action( 'generate_after_entry_header', 'generate_footer_meta' );
}
}
2-I would like to remove the icon that appears next to the meta fields.
Thank you very much
Hi Albert,
Can you try this PHP snippet instead and see how it goes?:
add_action( 'wp', 'your_move_footer_entry_meta' );
function your_move_footer_entry_meta() {
if ( is_single() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
add_action( 'generate_before_main_content', 'generate_footer_meta' );
}
}
With regards to the icon, here is a CSS code you can try:
.cat-links span.gp-icon.icon-categories {
display:none;
}
Here is an article with regards to adding CSS: https://docs.generatepress.com/article/adding-css/
Kindly let us know how it goes. :)
Thank you very much, everything works perfectly.
Another small query: how can I remove the commas that are shown between the categories?
You’re welcome Albert!
With regards to the commas, could you try adding the snippet here: https://docs.generatepress.com/article/generate_term_separator/
Kindly let us know how it goes. :)
Now instead of a comma a hyphen comes out. I don't want any symbols to appear.
You can see it here:
https://guia.amsterdam/aeropuerto-schiphol/
Hi there,
change your function to:
add_filter( 'generate_term_separator', function() {
return ' ';
} );
One last question. How do I add some space between the meta data and the title?
Try this CSS:
.entry-meta + .entry-title {
margin-top: 15px;
}