Skip to content

Instantly share code, notes, and snippets.

View edheltzel's full-sized avatar
🇺🇸
Just your average run-of-the-mill kinda guy

Mr. ED edheltzel

🇺🇸
Just your average run-of-the-mill kinda guy
View GitHub Profile
@edheltzel
edheltzel / gist:3163217
Created July 23, 2012 11:47 — forked from padolsey/gist:527683
JS: detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@edheltzel
edheltzel / gist:3806042
Created September 30, 2012 06:29
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@edheltzel
edheltzel / custom-wp-dashboard.php
Created October 11, 2012 13:44 — forked from arod2634/custom-wp-dashboard.php
Wordpress: Customize Admin Dashboard
<?php
//Add a custom admin dashboard welcome widget
function custom_dashboard_widget() {
echo '<h1>Welcome to your new WordPress site built by an awesome developer</h1>';
}
function add_custom_dashboard_widget() {
wp_add_dashboard_widget('custom_dashboard_widget', 'Integrity Welcomes You To WordPress!', 'custom_dashboard_widget');
}
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');
@edheltzel
edheltzel / gist:3872419
Created October 11, 2012 13:48 — forked from danielbachhuber/gist:1106704
Wordpress: Admin Improvements
<?php
/**
* Random set of improvements
*/
/**
* Tidy up the admin and remove options we don't need
*/
function db_clean_up_admin() {
@edheltzel
edheltzel / custom-wp-toolbar.php
Created October 12, 2012 15:32 — forked from arod2634/custom-wp-toolbar.php
Wordpress: Customize Admin Toolbar
<?php
// Customize Admin toolbar if you do desiced to keep it around...
function change_toolbar($wp_toolbar) {
$wp_toolbar->remove_node('comments');
$wp_toolbar->add_node(array(
'id' => 'myhelp',
'title' => 'Help',
'meta' => array('target' => 'help')
));
$wp_toolbar->add_node(array(
@edheltzel
edheltzel / customize-wp-tinymce.php
Created October 22, 2012 23:55 — forked from arod2634/customize-wp-tinymce.php
Customize Wordpress TinyMCE Editor
<?php
// Make TinyMCE editor awesome!
function make_mce_awesome( $init ) {
$init['theme_advanced_blockformats'] = 'h2,h3,h4,p';
$init['theme_advanced_buttons1_add'] = 'copy, cut, paste, redo, undo';
$init['theme_advanced_buttons2_add'] = 'anchor, hr, sub, sup';
$init['theme_advanced_disable'] = 'wp_help';
return $init;
}
@edheltzel
edheltzel / custom-wp-widgets.php
Created October 22, 2012 23:56 — forked from arod2634/custom-wp-widgets.php
Customize Wordpress Theme Widgets
<?php
/*
* Remove any unwanted widgets...
*
* WP_Widget_Pages = Pages Widget
* WP_Widget_Calendar = Calendar Widget
* WP_Widget_Archives = Archives Widget
* WP_Widget_Links = Links Widget
* WP_Widget_Meta = Meta Widget
* WP_Widget_Search = Search Widget
@edheltzel
edheltzel / custom-wp-menus.php
Created October 22, 2012 23:57 — forked from arod2634/custom-wp-menus.php
Customize Wordpress Admin Menus
<?php
//Remove any unnecessary admin menus & sub-menus
function my_remove_menu_pages() {
remove_menu_page('link-manager.php');
remove_menu_page('edit-comments.php');
//remove_menu_page('index.php');
//remove_menu_page('edit.php?post_type=page');
//remove_menu_page('upload.php');
//remove_menu_page('themes.php');
// Mobile First
@media screen and (min-width: 321px) { // iPhone landscape
}
@media screen and (min-width: 481px) { // iPad portrait
}
/* Generates current template file name - For debugging only! */
add_filter( 'template_include', 'var_template_include', 1000 );
function var_template_include( $t ){
$GLOBALS['current_theme_template'] = basename($t);
return $t;
}
function get_current_template( $echo = false ) {
if( !isset( $GLOBALS['current_theme_template'] ) )
return false;