This is really just a CSS question. The admin bar does its best to do this for all sites by giving a top margin to the <html>
element:
margin-top: 28px !important;
But if the theme uses certain positioning methods, that rule won’t have the desired effect, which is what is happening in your case.
From what you’ve said, this might fix the issue:
body { position:relative; }
Also, WordPress adds an .admin-bar class to the <body>
if you’re using body_class()
, so you could use that as a selector to fix the issue:
.admin-bar #my-logo { top: 28px; }
Either way, this is a CSS issue and not a PHP one. The actual CSS solution is off-topic for this site, so I’ll leave you hear and you can figure it out.
Related Posts:
- WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]
- Remove top admin bar
- How to Add Admin Bar and Admin Menu or Submenu Notification Bubbles?
- Deregister CSS style link ‘open-sans-css’
- Pure CSS to “float” to the right the number of children of an admin_bar child node
- WP Admin Bar transparent on some pages (.screen-reader-shortcut)
- Admin bar default color scheme for nonregistered/nonlogged users
- How can a left and right margin be added to the admin bar without access to “…wp-includes/admin-bar.php”?
- Bootstrap navbar-fixed-top issues [closed]
- What is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?
- Set line spacing
- Outline effect to text
- create a white rgba / CSS3
- Using CSS for a fade-in effect on page load
- Transition of background-color
- How to add a color overlay to a background image?
- css: how to center box div element directly in center?
- Transitions on the CSS display property
- What’s the HTML to have a horizontal space between two objects?
- HTML/CSS float: left; is not working properly
- How to get current screen width in CSS?
- margin-right is not working with my HTML. How can I center my content?
- CSS div width not working
- Positioning background image, adding padding
- CSS Box Shadow – Top and Bottom Only [duplicate]
- How to place Text and an Image next to each other in HTML?
- Click through div to underlying elements
- Responsive iframe with max width and height
- Overflow-x not working
- Inner glow effect of button
- Hexagon shape with CSS3
- CSS selector for first element with class
- Inbuilt style for jquery-ui-datepicker
- Why is style.css not being enqueued?
- How make theme css be first and not plugin css
- Hide Front-End Admin Bar Including 32 px Spacing
- When enqueing a stylesheet, is it possible to remove the type attribute? [duplicate]
- One WordPress and database but multiple subdomains
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- How can I remove css from a child theme?
- Can “ and “ tags be used in the HTML editor?
- wordpress in wamp lan doesn’t load css
- JavaScript added as link/stylesheet
- CSS style button For WP Login Function in page template
- WordPress Twenty Fourteen Theme Sidebar
- How to apply wordpress css styles to a jQueryUi dialog?
- Auto LTR-RTL Text Direction in wordpress post!
- Is there any size difference between single quote ‘ ‘ and double quote ” ” in CSS
- Admin pages missing css
- WordPress problematic caching
- why this media query is not working / not loading when I put it in child theme?
- Rendering css to screen and debug problem
- How to link theme fonts directory in WordPress CSS?
- WordPress custom styles in menu page
- Unable to align my sidebar to the contents section instead of comments
- Get post format and use it as a CSS class in different spans
- Can’t call custom css in style.php
- Using post_class to style posts indivdually
- Getting values from options page to css
- What is the best method to have Dynamic CSS?
- Load custom CSS before admin CSS
- Custom CSS is not working?
- How do I get access to the CSS Editor
- Style product detail page with custom CSS in woocommerce
- Using variable to display a page with a different stylesheet
- How can I style an IFRAME element that has a constantly changing class name? [closed]
- Twenty Twelve Calender Widget post titles creating disturbance
- why does this text overlaps in the sidebar?
- Combine CSS Files without plugin
- My site on mobile version is not giving responsive view
- JS button animation for ajax the WordPress style
- Missing “Additional CSS” option in Customizer
- check the first login for specific roles
- Trying to make an image a circle in Gutenberg
- How to style a list item when the radio input button within that li is :checked
- How to remove padding from left&right side
- adding additional class to get the post thumbnail [duplicate]
- links format change “on clic”
- Web Developer Console: “Slow network is detected.” with fonts
- Problem alignment issue with echo knowledge base
- Complex List Field – Gravity Forms
- issues with a slider – investigations with firebug
- My custom theme text and content format
- The placeholder text doesnt disappear
- Theme stylesheet not called properly on cloned website
- CSS Changes made, lost mobile functionality
- Display different css or Information based on previous page
- How to edit wordpress native gallery’s css file?
- a slider menu is compromised in space
- why css doesnt work when i change my file of wordpress and sql to another computer?
- Installing non-standard fonts [closed]
- I need css code to divide my webpage sections into two columns
- Images at the same vertical position in multiple columns
- css .active dropdown selects all links
- Put CSS on TOP, how?
- I am trying to apply these CSS rules to x3 Post-ID’s but I can’t get it to work – any idea how I can?
- In which file can I find the custom CSS code I entered?
- Some times CSS not Applying
- CSS does not take effects and it doesn’t show in inspect [closed]
- Add Quicksand for mobile devices