We're merging with GenerateBlocks! Learn more here.

[Resolved] Date and meta above all content

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Date and meta above all content

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1985
    Daniel
    Participant

    Hi!

    I’d like to have the date and meta above all content. Now both of them are below title.

    Is this possible?

    #1988
    Tom
    Keymaster

    Hi Daniel,

    Try this function:

    add_action( 'after_setup_theme','tu_move_post_meta' );
    function tu_move_post_meta() {
        remove_action( 'wpsp_after_title','wpsp_add_post_meta_after_title' );
        add_action( 'wpsp_before_header','wpsp_add_post_meta_after_title' );
    }
    #1989
    Daniel
    Participant

    Thanks Tom!

    That’s exactly what I was looking for.
    And in order to get the same layout (date + meta over the title) in default Generatepress blog layout and in single post view, is there another function you can share here, or do I need to copy and edit the template files in my child theme?

    Thanks again!
    Daniel

    #1991
    Tom
    Keymaster

    You could try this:

    add_action( 'after_setup_theme','tu_gp_move_meta' );
    function tu_gp_move_meta() {
        remove_action( 'generate_after_entry_title', 'generate_post_meta' );
        add_action( 'generate_before_content', 'generate_post_meta' );
    }
    #1993
    Daniel
    Participant

    Thanks again Tom.

    I had to modify the function a litte (I used ‘generate_before_entry_title’ instead of ‘generate_before_content’) in order to show the date over the title but keeping the featured image on top. But this function has move the date only, and I need to move the tags as well, now tags are still under the post content and I’m unable to figure out how to change that.

    #1997
    Tom
    Keymaster

    Change your function to this:

    add_action( 'after_setup_theme','tu_gp_move_meta' );
    function tu_gp_move_meta() {
        remove_action( 'generate_after_entry_title', 'generate_post_meta' );
        remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
    
        add_action( 'generate_before_entry_title', 'generate_post_meta' );
        add_action( 'generate_before_entry_title', 'generate_footer_meta' );
    }

    Hope this helps 🙂

    #1998
    Daniel
    Participant

    It really helps!
    As always, thank you for your support Tom.

    #2000
    Tom
    Keymaster

    Glad I could help! 🙂

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