Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Chutný petrchutny

View GitHub Profile
@petrchutny
petrchutny / Wordpress – Removing Dashboard Widgets.php
Last active Jul 28, 2017
Wordpress – Removing Dashboard Widgets
View Wordpress – Removing Dashboard Widgets.php
// 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 Jul 16, 2017
Enabling Gzip compression via this code in .htaccess in the root of a website
View Enable Gzip Compression
<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 Jul 28, 2017
Menu button changing colour on scroll (jQuery)
View Change Colour of Menu Button
// 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"});
You can’t perform that action at this time.