Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Hacks
    In reply to: Custom wp-admin Theme

    You can customize it to a degree through WordPress hooks and your functions.php file. This will keep you from needing to dig around in the core. As an example, you can add the following code to your theme’s functions.php and it will allow you to customize the below css to tweak and edit the look of the admin area.

    // custom logo/bg in wp-admin header
    function condor_custom_logo() {
       echo '
    	  <style type="text/css">
    	  	 #header-logo{ display: none;}
    		 #site-heading { background: url(' . get_template_directory_uri() . '/header-logo.png) no-repeat !important; width: 400px; height: 150px; text-indent: -9999px; }
    		 #wphead { height: 150px; background: #000 url(' . get_template_directory_uri() . '/header-bg-tile.jpg) top center repeat-x;}
    		 #wphead-info{padding: 55px 15px 0 0;}
    		 #user_info{ color: #ccc;}
    		 #user_info a:link, #user_info a:visited{color: #43c6fb;}
    	  </style>
       ';
    }
    add_action('admin_head', 'condor_custom_logo');

    If you’re looking to hide or remove functionality (ie. Appearance or Settings menu items), you’ll need to get into some more complex php or you’ll need to use one of the plugins for it. This one looks good: Admin Menu Editor

    Thread Starter soarwithcondor

    (@soarwithcondor)

    Of course, I figured out the solution half an hour after I finally post out of 2 days of frustration. Sigh.

    When loading images and javascript, it appears that you need to use: get_template_directory_uri() instead of TEMPLATEPATH. In other words, my custom defined constant above should look like this:
    define('CONDOR_ADMIN_IMG', get_template_directory_uri() . '/lib/admin/img' );

    Also, since I found out about this function just now, I’ll add some extra info for the archives…

    If you’re using child themes with the above function, you should consider changing it to: get_stylesheet_directory_uri() (otherwise the call above will reference the parent theme, not the child).

    Sigh… this always happens to me, haha. Anyway, glad I fixed it and hope this helps someone else in the future 🙂

Viewing 2 replies - 1 through 2 (of 2 total)