Replace your code with as mentioned below:
public function admin_body_class($classes) {
global $wpdb, $post;
$screen = get_current_screen();
$status="parent-";
if( isset( $post->post_parent ) && $post->post_parent > 0 ) {
$status="child-";
}
$classes .= ' ' . $status . $screen->post_type;
return $classes;
}
Related Posts:
- How to show an error message after publishing a post?
- Unwanted redirect in admin area
- Too many datadabse connections – upper ceiling mysql
- Adding body class to login page?
- 500 Internal Server Error after Register dialog, but with successful registration
- WP Database Error (Windows Server 2008 & SQL Server)
- How To Reset Ownership And Permissions of Wp-Content Folder, In Order to Fix HTTP Error When Uploading Images to WordPress Media Library
- How to create a WP Admin user in phpMyAdmin for WordPress 4.6
- Wp-admin is giving me an error “Sorry, you are not allowed to access this page.”. I do have access to the wp-admin besides the dashboard itself
- wp-admin 302 redirects
- class-wp-hook.php on line 288
- Cannot log in to the admin, no error message [closed]
- Uncaught SyntaxError: Unexpected Token Illegal
- Pages section (only) not loading after publishing large number of pages
- How do I fix wp-admin error when exporting reusable blocks?
- WordPress critical error on wp-admin page with 100% permissions
- Unable to access my page or WP Admin
- mixed contents admin panel is Unsecured
- How do I fix the 403 error for wp-admin/admin-ajax.php?
- Failed to load resource: the server responded with a status of 431 ()
- WordPress logged in but no access to wp-admin
- Can’t log into WordPress after domain change
- WordPress blog fails to open
- Why when I click on a link into the WP admin panel I am redirected to a link that doesn’t contains wp-admin prefix, so I obtain 404 error
- Can I rename the wp-admin folder?
- How to restrict dashboard access to Admins only?
- How to disable the “Post Lock/Edit Lock”?
- I’m getting a 404 message when I try to access wpadmin
- wordpress wp-admin css not loading
- Check if user is admin by user ID
- Highlight custom widgets in the admin area?
- wp-admin produces a 302 redirect to itself
- create users to site with specific language
- Hide a page in the admin end without a plugin?
- Prevent from deleting any user role but subscriber
- How to set custom editor style when editing the homepage?
- How to disable or hide “collapse menu”
- Login to wp-admin “redirect_to” points to wrong URL after migration
- WordPress wp-admin suddenly lost its style
- wp-admin blank in a clean install of WordPress on PHP 5.4 [closed]
- After changing Site url to https, can’t access login page
- Add custom content in user-edit.php page
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- How can I add my script to admin using script-loader.php?
- Admin first hook that outputs HTML?
- Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?
- wp-admin edit user url wont show up correct url [closed]
- Which HTTP headers to use for subdomain embedding?
- To remove default dashboard items and add quick draft widget for custom post type
- Why am I unable to login after converting to www?
- why my menu is not appearing on the admin panel
- Can’t access WordPress as an admin – but I can log in as a user!
- lock meta box position on post edit screen for contributors
- How do I host WordPress on a hidden domain through a reverse proxy?
- Clicking On View Post In Draft Opens New Tab
- Add javascript confirmation popup on “Move to Trash” link
- Users disappeared from wp-admin
- WordPress (behind HAProxy and Jetty), not multisite, in sub folder – and /en/wp-admin/ keeps redirecting to /wp-admin/
- Created a new subdomain with same content. Should I add a redirect in my old subdomain?
- WordPress isn’t reflecting changes I make to a specific file via FTP [closed]
- What are the requirements to make the admin toolbar show up on the front end
- Sorry, you are not allowed to access this page
- Screen Options & Help Buttons not working when including Bootstrap Css
- Hide username discovery
- Cookie Domain is preventing Admin login
- Cannot access WordPress login pages
- How to get Role Subscribe Users on Admin Menu only in Pages in WordPress
- Custom Admin Pagination links
- Have different site location for wp-admin in IIS
- Lost administrator privileges and can’t find a fix
- Why does do_robots() Allow: /wp-admin/admin-ajax.php by default?
- What is the meaning or function of this notice?
- How to set where user is redirected to after logging in at wp-login?
- How to display site title with post title?
- Cannot redeclare wp_update_core()
- Remove WP Admin Menu Items by User Role
- Our Team not showing on website [closed]
- How to create dependent dropdown custom field in wordpress admin post form
- Get current session in WP admin
- How do I make it so that the all users page is not a white screen?
- Show shipping class on product admin page
- How to remove the Login Customizer menu from the WordPress dashboard
- How to add a field on the user creation page?
- How to check if a user is in a specific role?
- Login redirect_to url is pointing to a url with the port
- How to load Dashboard default media files via HTTPS even when Browser URL has HTTP
- How to move “Collapse Menu” to top of admin bar?
- Some fields in Settings API form are saving, others are not
- I cannot get the “Read More” button to work!
- Child theme loses wp-admin styling
- Options site set empty fields after submitting
- Conditions for admin get_current_screen action parent_file edit.php?post_type=page
- Admin section showing CUSTOM Permalink structure thus resulting in permission error [closed]
- Hook into backbone to add js to wp-admin -> media library?
- Weird admin area
- is_admin() conditional statement
- Admin panel: Javascript not loading properly. Cannot edit pages/posts [closed]
- My website’s wp-admin redirects to another website’s wp-admin after pointing the site url to a subdirectiory
- Help please i cant login to wordpress panel [closed]
- Https Website: CSS and JS files load in http and admin page does not load too