0

I have included the theme's header.php into the WP-ADMIN using iframe but I wanna override certain styles and scripts so I called wp_head() with is_admin()

add_action('wp_head', 'wpse_43672_wp_head');
function wpse_43672_wp_head(){
    if(is_admin()){
        echo "THIS IS HEADER NOT IFRAME";
?>
<style>
    header {    
        position: absolute;
        top: 0;
        z-index: 9999;
        margin-top: 0;
    }
    .navbar-fixed-bottom, .navbar-fixed-top {z-index:9999 !important;}
    .sticky-menu #adminmenuwrap, #adminmenuwrap {position:relative !important;}
    .menu {padding:0 !important;}
    .navbar-wp-panel {margin-top:0 !important;}
    </style>

<?php   
    }}

But this didn't load anything I wanted as well I edited header.php of the theme also didn't work

<?php
if(is_admin()){
    echo "hello world!";
}

 wp_head(); ?>

Is there a solution to override an iframe page style or use is_admin() to load certain styles?

Your Answer

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

Browse other questions tagged or ask your own question.