Archived topic
Showing two .entry-meta divs on single posts, both above and below title
1 reply · Started by Ryan on November 16, 2020
I am trying to show the post date ABOVE the title and am using the code found in another thread:
function tu_move_posted_on() {
remove_action( 'generate_after_entry_title', 'generate_post_meta' );
add_action( 'generate_before_entry_title', 'generate_post_meta' );
}
add_action( 'after_setup_theme','tu_move_posted_on' );
However, my post date is showing both above AND below the title using that code. The remove_action does not appear to be removing the entry meta from the generate_after_entry_title hook. Running latest versions of both theme and premium. It's a site still in development and it was working properly prior to updating the theme over the weekend.
Hi there,
You do this instead:
Go to Appearance > Customize > Layout > Blog and uncheck Display date.
And then add this PHP snippet:
add_action( 'generate_before_entry_title', function() {
echo '<div class="entry-meta">';
generate_do_post_meta_item( 'date' );
echo '</div>';
} );