[wp-trac] [WordPress Trac] #40492: Twenty Fifteen: Jumping if there is content just before the closing body tag

WordPress Trac noreply at wordpress.org
Mon Oct 25 18:54:41 UTC 2021


#40492: Twenty Fifteen: Jumping if there is content just before the closing body
tag
-------------------------------------+------------------------------
 Reporter:  stephenharris            |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Bundled Theme            |     Version:  4.7.1
 Severity:  minor                    |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  javascript
-------------------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:  has-patch 2nd-opinion => has-patch needs-testing


Comment:

 Thanks for the report and patch!

 I refreshed the patch. Adding an element within `wp_footer` may be
 uncommon, but I was able to think of a use case: a back-to-top link.
 {{{
 function sabwp_twenty_fifteen_top_link() {
         echo '<a href="#page"
 style="background:rgba(255,244,111,0.8);color:#157;position:fixed;bottom:10px;right:10px;padding:10px;">Back
 to top</a>';
 }
 add_action('wp_footer', 'sabwp_twenty_fifteen_top_link', 10);
 }}}

 Changing the variable from `body` height to `#page` height seems to work.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40492#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list