Most of the developer face an issue with the WordPress admin bar overlapping when logged in. in this article I’ll discuss why this happen and what is the solution .
It only happen when you “fixed” the navbar position.
Example of:
Bootstrap 3x
Class : navbar-fixed-top
<nav class="navbar navbar-default navbar-fixed-top">
Example of:
Bootstrap 4x
Class: fixed-top
<nav class="navbar navbar-light bg-light fixed-top">
If you are still facing this issue. when you are not using bootstrap 3 or 4 framework.
Then check you CSS . it may cause
.your-navbar {
position: fixed;
}
How it can be solved ?
If you are using bootstrap 3x
Use this CSS code
body.admin-bar .navbar -fixed-top {
top: 28px; // set “px” value According to your project
}
Or
If you are using bootstrap 4x
Use this CSS code
body.admin-bar .fixed-top {
top: 28px; // set “px” value According to your project
}
Finally we fixed the issue here: