[Support request] Showing two .entry-meta divs on single posts, both above and below title

Home Forums Support [Support request] Showing two .entry-meta divs on single posts, both above and below title

Home Forums Support Showing two .entry-meta divs on single posts, both above and below title

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1533889
    Ryan

    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.

    #1533953
    Elvin
    Staff
    Customer Support

    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>';
    } );

    A wise man once said:
    "Have you cleared your cache?"

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.