Wordpress admin menu messed

2019-02-06 01:37发布

问题:

Today I have a really strange problem. My WordPress admin menu is a mess and disappears on hover. I've tried deactivating all the plugins, changing the theme, but nothing works.

Has anyone any ideas? I cannot check in "Firebug", because if I open it, my menu reloads and everything appears fine. It's the same if I refresh the page, but without change url. You can see it in the print screen.

I don't use any custom admin style or scripts.

Wordpress 4.3

回答1:

Which browser are you using? There is a known bug in chrome more info here: http://wptavern.com/a-bug-in-chrome-45-causes-wordpress-admin-menu-to-break

The source of the problem stems from Slimming Paint which is enabled by default in Chrome 45. Disabling slimming paint fixes the issue.

To disable this feature, visit chrome://flags/#disable-slimming-paint in Chrome and Enable the Disable slimming paint option, and make sure the other two Enable options are disabled because they will override the Disable option.

Also from the sounds of it looks like google will be fixing this as well soon

the Chrome Development bumped up the priority of the bug and a fix is likely come out before version 47 https://code.google.com/p/chromium/issues/detail?id=509179



回答2:

Add this to your functions.php to fix the bug not only in your browser but also in your client's. I tested it and worked well.

function admin_menu_fix() {
    echo '<style>
    #adminmenu { transform: translateZ(0); }
    </style>';
}
add_action('admin_head', 'admin_menu_fix');

Source: https://code.google.com/p/chromium/issues/detail?id=509179#c37 (page found by @NooBskie)



回答3:

Chrome has a rendering bug. There is a ticket open on Chrome's bug tracker about this issue, hopefully they will fix it soon.

In the meantime, here is a solution to eliminate the issue in Chrome.

  • Go chrome://flags/#disable-slimming-paint
  • Enable the "Disable slimming paint" option.
  • Ensure that the "Enable slimming paint" option below it is not turned on.
  • Then Relaunch Chrome.

Hope the problem will fixed.

You can also try the solution: https://code.google.com/p/chromium/issues/detail?id=509179#c37

This worked for me



回答4:

I think this going to be a short-lived thing, but a very weird one (especially compounded with hunting plugin breakages related to WordPress 4.3 simultaneously).

I just updated Google Chrome to the latest version and it is resolved. Before attempting any unusual fixes, I would recommend going to Chrome -> About Google Chrome first to make sure you're running the latest.



回答5:

Official Solution:

Disable slimmingPaint feature in chrome

1) In Chrome browser, navigate to: chrome://flags/#disable-slimming-paint (just enter the text into the address bar and hit enter)
2) You’ll see a list of technical options, with the “Disable slimming paint” option at the top; enable it
3) Disable the “Enable slimming paint” option if it’s enabled; just under the “Disable slimming paint” one
4) Relaunch Chrome

Other Solution:

If you or your clients don’t want to disable the Slimming Paint feature, then you can get around the bug by adding the following code into your theme functions.php file:

add_action('admin_enqueue_scripts', 'chrome_adminmenu_fix');

function chrome_adminmenu_fix() {
    if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Chrome' ) !== false )
        wp_add_inline_style( 'wp-admin', '#adminmenu { transform: translateZ(0); }' );
}


回答6:

I found the settings a little confusing at first, here's the simplification (possibly):

  1. Visit chrome://flags/#disable-slimming-paint in Chrome
  2. All the slimming paint options that have Disable keyword in their hashtag/flag must be in Enable state
  3. All the slimming paint options that have Enable keyword in their hashtag/flag must be in Disable state


标签: css wordpress