Skip to content

Instantly share code, notes, and snippets.

@ArtfulPussycat
ArtfulPussycat / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ArtfulPussycat
ArtfulPussycat / delete-multisite
Created November 16, 2016 16:23
delete-multisite
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/wordpress/';
define( 'DOMAIN_CURRENT_SITE', 'localhost' );
define( 'PATH_CURRENT_SITE', '/wordpress/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
@ArtfulPussycat
ArtfulPussycat / allow-multisite
Created November 16, 2016 16:25
Allow Multisite
define('WP_ALLOW_MULTISITE', true);
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
@ArtfulPussycat
ArtfulPussycat / functions.php
Created December 9, 2016 19:18
Hide "News from Modern Tribe" Admin dashboard panel
/*
* Remove "News from Modern Tribe" widget from dashboard
*/
function remove_tribe_dashboard_widget() {
remove_meta_box('tribe_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'remove_tribe_dashboard_widget');
@ArtfulPussycat
ArtfulPussycat / functions.php
Created December 9, 2016 19:25
Hide "Visual Composer" Admin menu item in WordPress
function custom_menu_page_removing() {
remove_menu_page('vc-welcome'); //vc
}
add_action( 'admin_menu', 'custom_menu_page_removing' );
@ArtfulPussycat
ArtfulPussycat / functions.php
Last active December 9, 2016 19:27
Hide Jetpack and disable direct access
function ap_remove_jetpack_page( ) {
if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
remove_menu_page( 'jetpack' );
}
}
add_action( 'admin_menu', 'ap_remove_jetpack_page', 999 );
add_action( 'admin_init', 'restrict_page' );
function restrict_page() {
if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
@ArtfulPussycat
ArtfulPussycat / style.css
Created December 29, 2016 16:14
DIVI - Change Hamburger menu icon color
span.mobile_menu_bar:before {
color: #ffffff !important;
}
@ArtfulPussycat
ArtfulPussycat / functions.php
Last active December 29, 2016 16:15
Clean up DIVI shortcodes when switching to another themeFrom https://divi.space/divi-tutorials/lets-talk-about-removing-the-divi-shortcodes/
function goodbye_divi_shortcode () {
$clean_content = get_the_content();
$clean_content = preg_replace('/\[\/?et_pb.*?\]/','', $clean_content);
return $clean_content;
}
add_filter('the_content', 'goodbye_divi_shortcode', 99, 1);
@ArtfulPussycat
ArtfulPussycat / styles.css
Created December 30, 2016 22:45
DIVI Static/Fixed menu
/** Fixed Mobile Menu **/
@media (max-width: 980px) {
.et_non_fixed_nav.et_transparent_nav #main-header, .et_non_fixed_nav.et_transparent_nav #top-header, .et_fixed_nav #main-header, .et_fixed_nav #top-header {
position: fixed !important; } }
.et_mobile_menu {
overflow: scroll !important;
max-height: 83vh;
}