Skip to content

Instantly share code, notes, and snippets.

View brandonhimpfen's full-sized avatar
🎯
Focusing

Brandon Himpfen brandonhimpfen

🎯
Focusing
View GitHub Profile
@brandonhimpfen
brandonhimpfen / functions.php
Last active May 13, 2026 16:37
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 / functions.php
Last active May 13, 2026 16:37
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 / functions.php
Last active May 13, 2026 16:37
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 May 13, 2026 16:37
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 May 13, 2026 16:37
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 / bootstrap-button-xl.css
Last active May 13, 2026 16:37
Add CSS for an extra large button.
.btn-xl {
padding: 15px 22px;
font-size: 24px;
line-height: 1.33;
border-radius: 6px
}
@brandonhimpfen
brandonhimpfen / bootstrap-html5-template.html
Last active May 13, 2026 16:37
Bootstrap template as per getbootstrap.com and bootstrap HTML5 template.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@brandonhimpfen
brandonhimpfen / .htaccess
Last active May 13, 2026 16:37
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 May 13, 2026 16:37
Add the following to your .htaccess file to change the default directory index page.
DirectoryIndex index.php index.html home.html