Skip to content

Instantly share code, notes, and snippets.

@kristarella
Created January 16, 2014 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristarella/8465003 to your computer and use it in GitHub Desktop.
Save kristarella/8465003 to your computer and use it in GitHub Desktop.
Back to top link that works in Genesis HTML5 framework
<?php
// custom header ID for backtotop
add_filter('genesis_attr_site-header','mytheme_header_id',1);
function mytheme_header_id($atts) {
$atts['id'] = "header";
return $atts;
}
// back to top link
add_action('genesis_footer','mytheme_backtotop');
function mytheme_backtotop() {
$atts = array(
'before' => '<div id="backtotop">',
'after' => '</div>',
'href' => '#header'
);
echo genesis_footer_backtotop_shortcode($atts);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment