ghlooki.blogg.se

Wordpress enqueue script on specific admin page
Wordpress enqueue script on specific admin page













WORDPRESS ENQUEUE SCRIPT ON SPECIFIC ADMIN PAGE CODE

You could just leave the code in the functions.php file but a plugin stays theme independent and means the client can have a degree of control by disabling it if they want the admin bar back on top.Ĭreating a plugin, albeit one that does nothing, to begin with, is very simple in WordPress. You don’t need much WordPress experience to hook into the system and add the necessary styling to override the default Admin Bar CSS, but why not add this to a handy little plugin! Then we can use it with other projects. It remains fixed to the bottom of the screen and is much less likely to affect other page components (unless the client wants some kind of crazy floating footer). So why not just move the admin bar to the bottom of the page?

wordpress enqueue script on specific admin page

But when building a site ‘content is king’ and the sooner a client can start populating their site ( and the admin bar certainly aids them in this task ) the closer we all get to a fully working site. Only admin’s see this bar so there is the temptation to leave this little job till later as you focus on the rest of the theme build. But things can get a bit cumbersome especially when considering different screen sizes and changes in design between them. With a little CSS we can sort this, adjusting where the website’s main menu sits on the screen when a user is logged in. The two fighting for dominance can drive you mad. Certainly a common technique to improve site usability and user experience.īut for site admins and editors, there is the WordPress Admin Bar wanting to remain firmly rooted to the top of the screen to deal with. This gives user’s a clear and easy way to navigate around the site while reading down each page and not having to scroll back up each time they want to visit another area of the site.

wordpress enqueue script on specific admin page

When you first hit the site you’ll want that top menu bar right at the top in clear view to aid site navigation, but when you scroll down the page, rather than lose that menu it remains fixed in place.

wordpress enqueue script on specific admin page

Working as a WordPress web developer in the top-tier building themes I’ve encountered the re-occurring client request for a fixed header.













Wordpress enqueue script on specific admin page