Skip to content

Instantly share code, notes, and snippets.

View petrchutny's full-sized avatar

Petr Chutný petrchutny

View GitHub Profile
@petrchutny
petrchutny / Wordpress – Removing Dashboard Widgets.php
Last active July 28, 2017 09:25
Wordpress – Removing Dashboard Widgets
// Main column (left):
$wp_meta_boxes['dashboard']['normal']['high']['dashboard_browser_nag']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']
// Side Column (right):
$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
// Then just use remove_meta_box( ) to remove these boxes
@petrchutny
petrchutny / Enable Gzip Compression
Created July 16, 2017 15:45
Enabling Gzip compression via this code in .htaccess in the root of a website
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@petrchutny
petrchutny / Change Colour of Menu Button
Last active July 28, 2017 09:22
Menu button changing colour on scroll (jQuery)
// Menu button changing colour on scroll
if($(".header").hasClass("white")) {
var button = $('button.mobile-menu path')
$(window).scroll(function(){
var scrollPos = $(window).scrollTop(),
headerHeight = $('.hero-background').height();
if(scrollPos > headerHeight) {
button.css({fill : "#000000"});
} else {
button.css({fill : "#FFFFFF"});