I'm trying to add floating button in admin page.

If I using

add_action('admin_footer', 'my_admin_function');

The button will in the bottom of the page and I need to scroll down.

I need the button always on the bottom of the screen and I don't have to scroll down.

Is there have action API that can add some code in the body?


Try doing little CSS work

.admin-button{position:fixed; bottom:20px; right:20px; z-index:999;}

add class to your button code, here I am using ".admin-button" for example .This will make your button appear in bottom 20px up and 20px away from right , more do as wherever you want to place.

Hope this small thing can work for you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.