Last active
August 29, 2015 14:05
-
-
Save hellofromtonya/11080ff43fe5b1066ce3 to your computer and use it in GitHub Desktop.
Move the Post/Page's Title (entry title) Just After '.site-inner' (Genesis Framework)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Remove the entry header from within the loop & | |
//* place it into a new hook 'lunarwp_entry_header | |
remove_all_actions('genesis_entry_header'); | |
add_action('lunarwp_entry_header', 'genesis_do_post_format_image', 4); | |
add_action('lunarwp_entry_header', 'genesis_entry_header_markup_open', 5); | |
add_action('lunarwp_entry_header', 'genesis_entry_header_markup_close', 15); | |
add_action('lunarwp_entry_header', 'genesis_do_post_title'); | |
add_action('lunarwp_entry_header', 'genesis_post_info', 12); | |
add_filter('genesis_markup_site-inner_output', 'lunarwp\do_page_header', 10, 2); | |
/** | |
* Add the page header HTML to the site-inner markup. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $tag site-inner HTML | |
* @param array $args | |
* @return string Amended site-inner HTML string | |
*/ | |
function do_page_header($tag, $args) | |
{ | |
if ('site-inner' != $args['context']) return $tag; | |
if (is_front_page()) return $tag; | |
//* capture the HTML and store it in a var | |
ob_start(); | |
do_action('lunarwp_entry_header'); | |
$entry_header = ob_get_contents(); | |
ob_end_clean(); | |
//* Add in the a new div for styling and the entry header | |
$tag .= sprintf('<div class="lunarwp-entry-header"><div class="wrap">%s</div></div>', $entry_header); | |
return $tag; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment