How to move entry header before main content

Community Forums Forums Design Tips and Tricks How to move entry header before main content

This topic is: resolved

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #105563

    brevityness
    Member
    Post count: 3

    I’m trying to emulate the single post entry header style on CSS-Tricks (example: http://css-tricks.com/theres-more-to-the-css-rem-unit-than-font-sizing/) where the post title spans its own row.

    The current markup looks like this:

    <div class="content-sidebar-wrap">
                 <main class="content">
                        <article>
                                    <header class="entry-header">...</header>
                       </article>
                </main>
               <aside>...</aside>
    </div>

    The end result I’m trying to achieve would look like this:

    <div class="content-sidebar-wrap">
                 <header class="entry-header">...</header>
                 <main class="content">
                        <article>...</article>
                </main>
               <aside>...</aside>
    </div>

    Thus far, I’ve been able to move the post title and post info but not its parent <header> container using the following function:

    add_action( 'get_header', 'single_move_entry_header');
    function single_move_entry_header() {
    	if ( is_singular() ){
    		remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    		remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    		remove_action( 'genesis_before_entry', 'genesis_do_entry_header' );
    		add_action( 'genesis_before_content', 'genesis_do_post_title' );
    		add_action( 'genesis_before_content', 'genesis_post_info' );
    	}
    }

    Anyone have any ideas what I can do? Thanks!

    http://css-tricks.com/theres-more-to-the-css-rem-unit-than-font-sizing/
    #105580

    braddalton
    Participant
    Post count: 10667

    This is what i would use:

    [php]
    remove_action( ‘genesis_entry_header’, ‘genesis_entry_header_markup_open’, 5 );
    remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 12 )
    remove_action( ‘genesis_entry_header’, ‘genesis_entry_header_markup_close’, 15 );
    [/php]

    Here’s an example http://wpsites.net/web-design/reposition-title-before-content-sidebar-wrap-like-the-nytimes-post-layout/


    #105581

    brevityness
    Member
    Post count: 3

    Nice! Thanks Brad. It worked.

    I was struggling to figure out the function that echoes the entry header. Is there a good documentation resource that I can look up this info? The best I could find is http://docs.garyjones.co.uk/genesis/2.0.0/ or digging through the Genesis Framework source code.

    #105591

    braddalton
    Participant
    Post count: 10667

    Digging through the Genesis Framework source code is the best way to really learn how it all works and the method i use to gain a deep understanding of Genesis and customizing child themes.

    I find the best way to learn is to work it out myself rather than use other peoples work which can simply be a copy and paste job that doesn’t really teach you much.

    Hope that helps and glad to hear you got it resolved.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.