We recently had the need to move the entire .site-footer
div in Genesis. There are various tutorials out there that suggest using the following code to relocate your footer content:
remove_action( 'genesis_footer', 'genesis_do_footer' ); add_action( 'new_hook', 'genesis_do_footer' );
However this won’t actually move the entire .site-footer
div. On the contrary, it will only relocate the contents of the div, which means you’ll end up with:
- An empty
.siter-footer
div - Your site-footer content orphaned somewhere on your page with no good semantic classes or IDs
Not good, right?
So if you want to properly move the entire site footer, use the following code (making sure to substitute the desired hook in place of new_hook
below):
// Move footer remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 ); remove_action( 'genesis_footer', 'genesis_do_footer' ); remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 ); add_action( 'new_hook', 'genesis_footer_markup_open', 5 ); add_action( 'new_hook', 'genesis_do_footer' ); add_action( 'new_hook', 'genesis_footer_markup_close', 15 );