Like our free content? Then you'll love our exclusive Club!
Divi Academy Membership gives you exclusive access to over 110 resources, including child themes, layouts, cheatsheets, tutorials, live training and member perks. And new content is added EVERY Monday!
Way back in 2016 I wrote a post on the top 10 free plugins I install on every Divi site. At the time I was still working with clients so I don’t really use most of them anymore, but I do still use around four or five of them on most sites I create, even if they are just my own demo sites.
One of the first I used to install was the free Floating Publish Button, but even when I wrote that post the plugin hadn’t been updated in a while, and whilst it is not a good idea to use unmaintanined plugins due to security risks, for the functionality the plugin provided, I didn’t think it was a big issue.
18 months on and it still hasn’t been updated so I thought I would share with you how I now float my publish button ![]()
If you have no idea what I am talking about, just watch the short video below and keep an eye on the red box to see what I mean.
So let’s get cooking!
Ingredients
The Divi Theme from Elegant Themes
An active child theme, we are going to be editing functions.php
Cooking time
Literally 2 minutes!
Preparation
No prep really, you just need to make sure you are using a child theme, otherwise this is gonna get overwritten when you update Divi.
Method
This is super simple, just open the functions.php file from your child theme in your favourite code editor, or in Appearance > Editor if you prefer and add the following function:
//Floating publish button
add_action('admin_head', 'ds_floating_publish');
function ds_floating_publish() {
echo '<style>
#submitdiv {
position: sticky;
top: 32px;
z-index: 9999;
}
</style>';
}
Keep in mind this won’t work in IE as it doesn’t support position: sticky; But I really hope you are not using IE to develop your sites ![]()
Now open up a long page, scroll down and watch your publish button float at the top of your screen. No more scrolling up and down each time you want to preview or publish your page/post ![]()
If you found this helpful please leave a comment and subscribe to my newsletter for all my latest Divi related content. ![]()
Michelle X





BLESS.
YOU.
Thank you Michelle. This is helpful today especially…day three of almost round-the-clock coding! Yikes!
By the way, your own site’s left handed main menu is so cool! Clearly you’re in love with CSS. Me too. Wonder who the authors are on your desk side bookshelf . . . hmmm.
Best regards,
F.
Haha thanks Frederick, yes I have been in love with CSS since the day I discovered it
I mostly listen to audio books but for coding I like something I can hold and also have some books when audio is not available. My two newest are The New CSS Layout by Rachel Andrew and Design for how People Learn by Julie Dirksen
Design How People Learn just went into my shopping cart and will be the next book I read. Thanks for recommending it!
Hi Michele,
I am the author of the plugin, I am very happy to see the plugin useful for WordPress users
I have been busy with a new family for years, it’s time to be back and maintenance this plugin.
Thanks a lot,
Son Do
Look forward to the update!
That would be awesome
I use the ‘Toolbar Publish Button’ plugin for that. It adds the 3 buttons from the publish box to the top toolbar from WP. I Tried your code as a replacement to have one plugin left but couldn’t get it to work. It did stick at the top, but always half way or below the publish box. I tested with Chrome and Firefox and with different top values.
Apolgoies John I missed a line of code which has been rectified now so you can try it again and it should work fine
Cool, thank you Michelle, now it works! Let’s see if I can get used to this one in stead of the plugin I use now.
Hi Michelle, I used Floating Publish Button and just now I tried your code, but unfortunately it still doesn’t work completely. It floats until the underlying boxes (Page Attributes and Featured Image) catch up with the Publish box and then the Publish button goes up with the rest of them… Funny, eh?
Yup, it’s happening to my site too. Float until Featured Image then goes up with the rest.
Yes it will float up when you get right to the bottom. I usually have a lot of stuff in the right hand column so it doesn’t really affect it but you can take a different approach by using a fixed instead of sticky position, so swap out the CSS for this: #submitdiv { position: fixed; top: 95px; z-index: 9999; } #et_settings_meta_box { margin-top: 200px; } You would need to make sure the publish box is at the top and the Divi page settings box is second, then just play with the values a little to make sure it is… Read more »
Your code dont work ;(
dont go down when right menu is end http://prntscr.com/l084hj =(
Yes it stops at the end we know. You can use a jQuery solution to make it stay there.