[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 Mar 21 21:01:21 UTC 2022


#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:  6.0
Component:  Bundled Theme            |     Version:  4.7.1
 Severity:  minor                    |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  javascript
-------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  has-patch needs-testing dev-feedback => has-patch needs-
               testing


Comment:

 I found my mistake: using fixed position to show the link made the `body`
 and `#page` height values the same. Text alignment with static position
 displays the link, and the body height is greater than `#page`.

 {{{
 function sabwp_twenty_fifteen_top_link_static() {
         echo '<div style="text-align:right;"><a href="#page"
 style="background:rgba(255,244,111,0.8);color:#157;padding:10px;">Back to
 top</a></div>';
 }
 add_action('wp_footer', 'sabwp_twenty_fifteen_top_link_static', 10);
 }}}

 The post content area needs to be shorter than the header, too.

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


More information about the wp-trac mailing list