php
<?php
function custom_header_button_script() {
    ?>
    <style>
        #scrolling-button {
            display: none;
        }
    </style>
    <script>
        jQuery(document).ready(function($) {
            $(window).scroll(function() {
                var scroll = $(window).scrollTop();
                if (scroll >= 50) {
                    $("#scrolling-button").fadeIn(200); // fadeIn duration
                } else {
                    $("#scrolling-button").fadeOut(200); // fadeOut duration
                }
            });
        });
    </script>
    <?php
}
add_action('wp_head', 'custom_header_button_script');