1

I am trying to modify css.

enter image description here

I tried to modify the css with below code but does seems to work. if i try to change the color it works.

 #poststuff #post-body.columns-2 {
    margin-right: 300px;
    display:flex important;
    flex-direction:column !important;
}

It seems to work in if i modify directly form the chrome developer.

function wpdocs_selectively_enqueue_admin_script( $hook ) {
    if ( 'toplevel_page_kita-general-settings' != $hook ) {
        return;
    }
    // wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'myscript.js', array(), '1.0' );
    wp_enqueue_style( 'kita_options_page', get_template_directory_uri() . '/css/kita-admin.css' );


}
add_action( 'admin_enqueue_scripts', 'wpdocs_selectively_enqueue_admin_script' );
4

If its just that one style you want to edit, you could try...

add_action('admin_head', 'admin_styles');

function admin_styles() {
    echo '<style>
        #poststuff #post-body.columns-2 {
            margin-right: 300px;
            dispay:flex important;
            flex-direction:column !important;
        }
    </style>';
}

Or add a separate stylesheet with something like this...

add_action('admin_head', 'admin_styles');

function admin_styles() {
    echo '<link rel="stylesheet" href="style.css" type="text/css" media="all" />';
}
6
  • hi,thanks..tried but it is not working. its still loads from load-styles.php . Sep 18 '18 at 17:01
  • What exactly are you trying to override? Also, how are you creating this theme options page? Sep 18 '18 at 17:06
  • its not actually overriding ...i tried to move the publish button to bottom..these were the newly added codes:dispay:flex important;flex-direction:column !important; Sep 18 '18 at 17:08
  • Well display is spelled wrong and you are missing the ! before important Sep 18 '18 at 17:12
  • oh yes . above code works . Thanks How can i target the specific page : 'toplevel_page_kita-general-settings' Sep 18 '18 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.