-
Notifications
You must be signed in to change notification settings - Fork 17
/
functions.php
47 lines (32 loc) · 1.22 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
// Saftey first.
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'functions.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly, Hassan!');
// Plug it
header('X-Powered-By: Semantics are everything. [email protected] for more info.');
// Add awesome brower classes to body tag
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
elseif($is_chrome) $classes[] = 'chrome';
elseif($is_IE) $classes[] = 'ie';
else $classes[] = 'unknown';
if($is_iphone) $classes[] = 'iphone';
return $classes;
}
// Remove usless the_generator meta tag - whoops
add_filter( 'the_generator', create_function('$a', "return null;") );
// Custom Logo
function custom_logo() { ?>
<style type="text/css">
h1 a { background-image: url(
<?php get_bloginfo('template_directory'); ?>/img/logo-login.gif
) !important) }
</style>
<?php }
add_action('login_head', 'custom_logo');