In XHTML Genesis themes, the site footer usually comprises two parts. One of these is a back to top link that instantly returns the user to the top of the page. HTML5 Genesis themes do not feature the back to top link.
Genesis provides a filter that can be used to edit the back to top link, replace it with something more useful or remove it altogether from your XHTML theme.
The filter to use is
genesis_footer_backtotop_text. The back to top shortcode passes through this filter before being parsed and subsequently output.
Despite the name, you can add not just a back to top link but any content and any shortcodes you want to this filter. Usually, this content will display on the left hand side of the footer in an XHTML Genesis theme.
This filter does NOT take any effect in HTML5 Genesis themes. See below for alternatives.
The basic usage of the filter
genesis_footer_backtotop_text is below. Just replace
your_function_here with your function.
Example 1: change the text of the back to top link.
Example 2: remove the back to top link altogether.
The only argument passed through this filter is the content to be output in the left hand side of the footer.
The default value of the filter is
[footer_backtotop], which is a shortcode that produces a back to top link.
There are no filters applied to
genesis_footer_backtotop_text by default.
Genesis Simple Edits
As an alternative to installing code in your child theme functions, you can edit this filter via the popular plugin Genesis Simple Edits.
Although the filter
genesis_footer_backtotop_text has no effect in HTML5 themes, it is still possible to create a back to top link in an HTML5 theme.
You can do this by passing the back to top shortcode into the
genesis_footer_creds_text filter, as long as you specify a valid
href attribute (the default is
#wrap which will only work with XHTML themes).
genesis_footer_backtotop_text is located in lib/structure/footer.php.
- How to Edit the Site Footer Text with Genesis
- How to Edit the Entire Site Footer with Genesis
- How to Remove, Rewrite or Move the Site Footer with Genesis
Relevant tutorials from the Genesis community.