When I log in to WordPress, the layout of the template breaks

1

I'm developing a WordPress template for a client, but when I log into wp-admin, then the slide show does not work and the layout breaks, everything looks as if it had a CSS error. p>

But if I open an anonymous tab in the browser, it opens normal and beautiful!

Does it have anything to do with the session created when you log in?

    
asked by anonymous 16.09.2015 / 17:37

1 answer

3

When the user is logged in, the WordPress WP Admin menu ( default ) appears and adds the following style sheets:

<link rel='stylesheet' id='dashicons-css'  href='http://example.com/wp-includes/css/dashicons.css?ver=4.1.8' type='text/css' media='all' />
<link rel='stylesheet' id='admin-bar-css'  href='http://example.com/wp-includes/css/admin-bar.css?ver=4.1.8' type='text/css' media='all' />

And also add a script and this div at the end of the HTML:

<script type='text/javascript' src='http://example.com/wp-includes/js/admin-bar.js?ver=4.1.8'></script>
<div id="wpadminbar" class="nojq nojs" role="navigation">

You can disable this bar individually in each user's profile or use this line of code to disable general:

add_filter('show_admin_bar', '__return_false');

Normally I recommend putting this type of code in a custom plugin, but since it is so simple it can be pasted into the functions.php file of your theme.

If not, it may be some plugin that only works when the user is logged in, to confirm turn off all the plugins and check if the error continues.

    
16.09.2015 / 17:55