Skip to content

Instantly share code, notes, and snippets.

@brandonhimpfen
brandonhimpfen / gist:6412098
Last active December 22, 2015 03:39
WordPress: "Add HTML5 Shim To Your Theme’s Header" - Add this function to your theme’s functions.php file.
// add HTML5Shim to your theme's header
function html5_shim () {
echo '<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->';
}
add_action('wp_head', 'html5_shim');
@brandonhimpfen
brandonhimpfen / gist:6412103
Last active December 22, 2015 03:39
WordPress: "Disable Admin Bar When Logged In" - Add the following to your theme’s functions.php file to remove the admin menu bar from your website when logged into WordPress.
// Remove admin bar
add_filter('show_admin_bar', '__return_false');
@brandonhimpfen
brandonhimpfen / gist:6412112
Created September 2, 2013 11:58
WordPress: "Remove WordPress Meta Generator" - Add the following to your theme’s functions.php file to remove WordPress’s generator meta tag.
// Remove WordPress Meta Generator
remove_action('wp_head', 'wp_generator');
@brandonhimpfen
brandonhimpfen / README
Created September 12, 2013 17:46
Will show the parameter of the WordPress bloginfo function.
Use [bloginfo value="name"] to display the output. Replace name with the parameter you want.
List of parameters can be found at http://codex.wordpress.org/Template_Tags/bloginfo
@brandonhimpfen
brandonhimpfen / .htaccess
Last active December 23, 2015 04:39
Disallow outside access of your wp-config.php file.
<files wp-config.php>
order allow,deny
deny from all
</files>
@brandonhimpfen
brandonhimpfen / .htaccess
Last active December 23, 2015 06:19
Deny access to login to WordPress, except for defined IP addresses.
<Files wp-login.php>
Order Deny,Allow
Deny from all
Allow from xx.xx.xx.xx
</Files>
@brandonhimpfen
brandonhimpfen / gist:6738915
Created September 28, 2013 05:58
Add CSS for an extra large button.
.btn-xl {
padding: 15px 22px;
font-size: 24px;
line-height: 1.33;
border-radius: 6px
}
@brandonhimpfen
brandonhimpfen / gist:6822607
Created October 4, 2013 08:14
Bootstrap template as per getbootstrap.com and bootstrap HTML5 template.
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
@brandonhimpfen
brandonhimpfen / .htaccess
Last active December 24, 2015 21:29
Set expires which conforms to Google's PageSpeed testing. Add the code to your .htaccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
@brandonhimpfen
brandonhimpfen / .htaccess
Last active December 25, 2015 00:09
Add the following to your .htaccess file to change the default directory index page.
DirectoryIndex index.php index.html home.html