Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to move entry header before main content
- This topic has 3 replies, 2 voices, and was last updated 10 years, 9 months ago by
Brad Dalton.
-
AuthorPosts
-
May 16, 2014 at 5:40 pm #105563
brevityness
MemberI'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/May 16, 2014 at 9:38 pm #105580Brad Dalton
ParticipantThis is what i would use:
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 );
Here's an example http://wpsites.net/web-design/reposition-title-before-content-sidebar-wrap-like-the-nytimes-post-layout/
May 16, 2014 at 9:58 pm #105581brevityness
MemberNice! 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.
May 16, 2014 at 11:18 pm #105591Brad Dalton
ParticipantDigging 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.