Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add a header in the backstage in order to look more blend in like the frontend. Nothing much I want to add, just the header and footer is enough. The content section remains the original style.

But I can't find an appropriate hook to this area. I tried to add get_header(); into admin-header.php and it works. However, I don't want to mess up with wp core files, so is there any way to add the files?

UPDATE

After months of resarching, I finally gave up this thought that adding frontend header and footer to the backend. Instead, I just use the frontend pages to become the user dashboard. Although, this involved a lot of work (I do it manually, not by a plugin), but it is more flexible.

However, still thanks for the advices/suggestion.

share|improve this question

6 Answers 6

The in_admin_header action may be used to insert content before <div id="wpbody"> in the wordpress backend.

See Line 101 of /wp-admin/admin-header.php (line number as of version 3.3.2)

Further reading on actions: Action Reference, codex

share|improve this answer
    
yes..this work as well, but it still show the menu on the left,not wrapped under the main body... i do find admin_head can do that, but it add the header in the <head></head> section which is also not a ideal solution...nevertheless still thanks for your tips... –  dev-jim May 4 '12 at 11:35

From your description the part you'd like to wrap is probably div of wpwrap class. However there are no fitting hooks outside it, as well as you will need to do something with toolbar and so on.

WordPress admin side is considered (so far) very inflexible and hard to deeply customize, comparing to front end. It might make more sense to work with CSS styling and existing elements of it, rather than trying to introduce major new elements.

share|improve this answer

Are you trying to make the backend look for like the frontend so that when users access their profile?

Otherwise, what is the reason you want the header and footer in the backend?

If you want to give user access to their profile, you can use http://wordpress.org/extend/plugins/user-meta/ to make a front end profile / dashboard that has the header and footer.

There are also several functions and plugins that can off un-needed profile fields.

share|improve this answer

Something that gets in the way of the header/footer concept is the left-side Admin Menu.
But with Ozh' Admin Drop Down Menu help, and its companion Admin Menus Fixed, it's possible to get the menu in another position and insert our custom upper and lower HTML.

enter image description here
click to enlarge

add_action( 'in_admin_header', 'insert_header_wpse_51023' );
add_action( 'admin_footer', 'insert_footer_wpse_51023' );
add_filter( 'admin_print_styles', 'footer_hide_wpse_51023' );

function insert_header_wpse_51023()
{
    echo '<div style="width:100%"><img src="http://example.com/header.jpg" width="100%" /></div>';
}

function insert_footer_wpse_51023()
{
    echo '<div style="width:100%"><img src="http://example.com/footer.png" width="100%" /></div>';
}

function footer_hide_wpse_51023()
{
    echo '<style type="text/css">#wpfooter { display: none; }</style>';
}
share|improve this answer

I know this might seem crazy but using iframes of the header and footer and add to functions.php or create a plugin:

function frontheader() {
    echo 'IFRAME';
}
add_action('admin_head', 'frontheader');

function frontfooter() {
    echo 'IFRAME';
}
add_action('admin_footer', 'frontfooter');
share|improve this answer
    
I don't think this is going to work as you expect. admin_head fires inside the <head> section. admin_footer may work. –  chrisguitarguy Nov 21 '12 at 23:13
    
your right it would be that –  user1757516 Nov 22 '12 at 0:09
    
if it works can you mark my answer as accepted –  user1757516 Nov 24 '12 at 4:12

Add this to function.php

add_action( 'admin_head', 'insert_header_wpse_51023' );

function insert_header_wpse_51023()
{
    echo '  <div class="header">
            content for your header
            </div>';
}
share|improve this answer
1  
You cannot place a div element in a head element. That’s invalid HTML. –  toscho May 30 at 9:56
    
it works for me –  hzrcan May 30 at 9:57
    
It creates invalid HTML. Just because it looks OK in some browsers, it isn’t already “working”. –  toscho May 30 at 10:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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