Edit admin post page

I have to customize the admin page where you edit the other pages “wp-admin/post.php”. I have to add a lot of things, and delete others, change colors and add a custom menu to the top.

I don’t know how to start searching for this. Are there any hooks, or funtions to change the HTML in the page editor?

I know how to add a CSS/JS file. But not how can I add HTML/PHP elements.

function admin_css() {
    wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/css/admin.css' );
}
add_action('admin_print_styles', 'admin_css' );

Thanks a lot

Solutions Collecting From Web of "Edit admin post page"

There are functions available in WordPress to add/remove the elements. For instance to remove existing elements on WordPress backend page editor you can use remove_post_type_support function. Below is example usage:

<?php
add_action( 'init', 'my_remove_post_type_support', 10 );
function my_remove_post_type_support() {
    remove_post_type_support( 'post', 'custom-fields' );
}
?>

The above snippet will remove custom-fields box from edit page section on backend.

In similar manner you can add element using add_post_type_support() function. For instance ‘Excerpt’ element is not present by default for WordPress pages. You can add that using following code:

<?php
add_action('init', 'my_custom_init');
function my_custom_init() {
    add_post_type_support( 'page', 'excerpt' );
}
?>

To add custom elements other than what are supported by WordPress under add_post_type_support() function you will have to use add_meta_box(). You may refer to examples mentioned on codex and customize the code to suit your needs: https://codex.wordpress.org/Function_Reference/add_meta_box

About admin styles, WordPress by default provides different admin skins which can be checked under “Users > Your Profile”. To add custom skin use following:

<?php
 wp_admin_css_color(
   'Soothing',
   __('Soothing'),
   admin_url("css/colors-classic.css"),
   array('#07273E', '#14568A', '#D54E21', '#2683AE')
 );
?>

Change the array of color codes as per your requirements.

I suggest you build a plugin for all above so that when the theme is changed you still retain that functionality. Also for custom admin skin you will need to provide the actual admin css file path in place of admin_url. The above code would show the new skin on option on backend but it won’t apply the skin as the css file path won’t render.