Skip to content

Instantly share code, notes, and snippets.

View weekendlah's full-sized avatar

Weekend Lah weekendlah

View GitHub Profile
@weekendlah
weekendlah / functions​.php
Created May 24, 2017 11:52
Remove All Dashboard Widgets
/**
* Remove All Dashboard Widgets
*/
function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
@weekendlah
weekendlah / functions.php
Created May 24, 2017 10:21
Customizing jepack’s related posts on mobile device
function jetpackme_more_related_posts( $options ) {
if(wp_is_mobile()):
$options['size'] = 2;
else:
$options['size'] = 3;
endif;
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_more_related_posts' );
@weekendlah
weekendlah / .htaccess
Created May 21, 2017 12:27
WordPress security
# Don’t show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# CHANGE mod_php5.c TO mod_php7.c IF YOU RUN PHP7.
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Protect XMLRPC (needed for apps, offline blogging tools, pingback, etc.)
# If you use that, these tools will not work anymore