Media Upload not working after hiding some elements from functions.php

Replace your code with this code:- add_action(‘wp_footer’, ‘myCssCode’, PHP_INT_MAX); function myCssCode() { ?> <style> #toplevel_page_wpcf7, #wp-admin-bar-wp-logo, #screen-meta-links, #menu-tools, #wp-admin-bar-wpseo-menu, #footer-upgrade, #toplevel_page_wpfront-user-role-editor-all-roles, #toplevel_page_vc-general, #menu-settings, #toplevel_page_wpseo_dashboard, #toplevel_page_revslider, #toplevel_page_themepunch-google-fonts, #menu-appearance, #wp-admin-bar-snap-post, .error { display:none; } </style> <?php }

Custom css author role

If a user is not logged in then admin_head probably won’t run. So let’s just check their capabilities. function my_custom_admin_head() { if ( ! current_user_can( ‘have-fun’ )) : ?><style> #welcome-panel{display: none !important;} #wp-content-editor-tools{display: none !important;} </style> <?php endif; // cant’ have-fun } add_action( ‘admin_head’, ‘my_custom_admin_head’ );

Margin problem on management menu?

You can’t modify WordPress’ admin CSS. Well, technically you could, but it’d just get overridden the next time you update WordPress. The solution to this is to add your own custom CSS file to override the parts you wish to. In your theme’s functions.php, you can add a new CSS file to be loaded only … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)