How to Edit the Back to Top Link with Genesis

How to Use genesis_footer_backtotop_text to

Edit the Back to Top Link with Genesis

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.

Filter

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.

Basic Usage

The basic usage of the filter genesis_footer_backtotop_text is below. Just replace your_function_here with your function.

Examples

Example 1: change the text of the back to top link.

Example 2: remove the back to top link altogether.

Arguments

The only argument passed through this filter is the content to be output in the left hand side of the footer.

Default Value

The default value of the filter is [footer_backtotop], which is a shortcode that produces a back to top link.

Default Filters

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.

HTML5 Themes

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).

Source File

The filter genesis_footer_backtotop_text is located in lib/structure/footer.php.

a2z Entry

Add a Comment

Your email address will not be published. Required fields are marked *