When I start a session in Wordpress, the template layout breaks

Asked

Viewed 335 times

1

I am developing a Wordpress template for a client, but when I soon in wp-admin, then the slide show does not work and the layout breaks, everything looks like CSS error.

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

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

  • Maybe there are custom settings in your user, try to create a new user and log in with this user.

  • I created another user but it didn’t work!

  • So it’s a user-related configuration. It tries to compare the logged-in user’s HTML code and the logged-in one. Versifies if something else is not being added.

1 answer

3

When the user is logged in, the WP Admin menu appears (default wordpress) which 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 adds a script and this div at the end of 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 as it is so simple can be pasted into the file functions.php of your Theme.

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

  • Exactly what I imagined :D, good!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.