Skip to content

Instantly share code, notes, and snippets.

View schalkburger's full-sized avatar
💪
eat sleep code repeat

Schalk Burger schalkburger

💪
eat sleep code repeat
View GitHub Profile
@schalkburger
schalkburger / custom-login-logo-wordpress.php
Last active August 29, 2015 14:11
Custom login logo for Wordpress
function my_custom_login_logo() {
echo '<style type="text/css"> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/logo-login.gif) !important; } </style>';
}
add_action('login_head', 'my_custom_login_logo');
@schalkburger
schalkburger / deregister-styles-wordpress.php
Last active August 29, 2015 14:11
Deregister styles in Wordpress
function my_deregister_styles() {
wp_deregister_style('contact-form-7');
}
add_action('wp_print_styles', 'my_deregister_styles', 100 );
@schalkburger
schalkburger / wordpress-favicon.php
Last active August 29, 2015 14:11
Add favicon to Wordpress
function add_favicon() { ?>
<link rel="icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico" />
<?php }
add_action('wp_head', 'add_favicon');
@schalkburger
schalkburger / wordpress-remove-menus.php
Last active August 29, 2015 14:11
Removes menus in Wordpress
function remove_menus () {
global $menu;
$restricted = array(__('Appearance'), __('Tools'), __('Settings'), __('Plugins'));
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menus');
@schalkburger
schalkburger / wordpress-breadcrumbs.php
Last active August 29, 2015 14:11
Simple WordPress page breadcrumbs
function the_breadcrumb() {
global $post;
echo '<ul>';
if (!is_home()) {
$parent_link = get_permalink($post->post_parent);
echo '<li><a href="';
echo $parent_link;;
echo '">';
echo ''.get_the_title($post->post_parent).'';
echo "</a></li>";
@schalkburger
schalkburger / addthis-custom-buttons.html
Last active August 29, 2015 14:15
AddThis custom buttons
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook social-icon"> <img src="/img/icon-social-facebook.png" width="57" height="57" border="0" alt="Share" />
<a class="addthis_button_twitter social-icon"> <img src="/img/icon-social-twitter.png" width="57" height="57" border="0" alt="Share" />
<a class="addthis_button_google social-icon"> <img src="/img/icon-social-google.png" width="57" height="57" border="0" alt="Share" />
<a class="addthis_button_email social-icon"> <img src="/img/icon-social-email.png" width="57" height="57" border="0" alt="Share" />
</a>
</div>
@schalkburger
schalkburger / ie-conditional.html
Created February 16, 2015 13:36
Internet Explorer conditional statements
<!--[if lt IE 9]>
According to the conditional comment this is less than Internet Explorer 9
<![endif]-->
<!--[if IE 9]>
According to the conditional comment this is Internet Explorer 9
<![endif]-->
<!--[if gt IE 9]>
According to the conditional comment this is greater than Internet Explorer 9
@schalkburger
schalkburger / clearfix.css
Last active August 29, 2015 14:15
The new micro clearfix hack
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.clearfix:before,
@schalkburger
schalkburger / css-crossbrowser-opacity.css
Last active August 29, 2015 14:15
CSS Cross-browser opacity
.opacity {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50);
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
@schalkburger
schalkburger / url-after-anchor.css
Created February 16, 2015 13:48
Display URL after anchor element
a:after {
content: attr(href);
}