Site logo

Archived topic

Two questions about meta data on entries

7 replies · Started by Albert on February 24, 2022

Viewing posts 1–8 of 8

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?

Hi there,

change your function to:

add_filter( 'generate_term_separator', function() {
    return ' ';
} );

Try this CSS:

.entry-meta + .entry-title {
    margin-top: 15px;
}
This archived topic is closed to new replies.