Site logo

Archived topic

Move Entry-header above content and sidebar

3 replies · Started by easiii on September 23, 2018

Viewing posts 1–4 of 4

Hello,
I would like to know if possible, what code do I need to add the function.php to move the entry-header (title & meta) above the sidebar & content. I've bought generatepress premium however I don't want to use neither GP Hooks or Page Header to do this. I just want the code that needs to be added in the function.php. Thank you!

Hi there,

Using the Elements module is definitely the best way to do this.

If you're not interested in doing that for some reason, you could try this:

add_filter( 'generate_show_title', '__return_true' );
remove_action( 'generate_after_entry_title', 'generate_post_meta' );
add_action( 'generate_before_main_content', 'generate_post_meta', 15 );

add_action( 'generate_before_main_content', function() {
    the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
} );

Thank you, Tom!
If we were to use the Elements add-on - is there any guide we can follow to do this?

If you were to use Elements, you'd add a new "Header" element.

Then you'd add the post title, date, author etc.. to the Page Hero content area using the template tags (seen in the right sidebar).

This might help: https://docs.generatepress.com/article/header-element-overview/

Let me know if you need more info :)

This archived topic is closed to new replies.