Skip to content

Instantly share code, notes, and snippets.

Enterprise Branding EnterpriseBranding

View GitHub Profile
@EnterpriseBranding
EnterpriseBranding / functions.php
Created Mar 25, 2019 — forked from maddisondesigns/functions.php
Remove the annoying Wordfence Notifications on plugin updates and plugin activation
View functions.php
<?php
/*
* Remove the annoying Wordfence Notifications. Tested with Wordfence v6.3.2
*/
class ahRWN_Remove_Wordfence_Notification {
private $wordfencePluginFile;
public function __construct() {
$this->wordfencePluginFile = "wordfence/wordfence.php";
register_activation_hook( $this->wordfencePluginFile, array( $this, 'rwn_remove_wordfence_notifications_on_activation' ) );
@EnterpriseBranding
EnterpriseBranding / woocommerce-optimize-scripts.php
Created Mar 16, 2019 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
View woocommerce-optimize-scripts.php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@EnterpriseBranding
EnterpriseBranding / register-post-type.php
Created Feb 6, 2019 — forked from justintadlock/register-post-type.php
Help file when registering post types.
View register-post-type.php
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@EnterpriseBranding
EnterpriseBranding / .htaccess
Created Jan 17, 2019 — forked from HechtMediaArts/.htaccess
UPDATE 2019: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
View .htaccess
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
View woocommerce responsive table
Extracted from here. Alternative to solution below would be to hide the single product column (4th column) in mobile view.
http://cyberchimps.com/forum-topic/woocommerce-cart-page-still-doesnt-fit-on-mobile-2/page/2/
The following solution of breaking the table to make it responsive seems to work quite well (principally by using td display:block).
Adpating Chris Coyier’s Responsive Data Tables article: http://css-tricks.com/responsive-data-tables/
Using this method allows the font size to remain at full size, which is good for smartphone viewing.
I’m using TwentyThirteen theme (child theme). If you had further cart plug-ins they might need CSS work too.
@EnterpriseBranding
EnterpriseBranding / wc-allow-shortcodes.php
Created Jan 7, 2019 — forked from woogists/wc-allow-shortcodes.php
Allow shortcodes in product excerpts
View wc-allow-shortcodes.php
/**
* Allow shortcodes in product excerpts
*/
if (!function_exists('woocommerce_template_single_excerpt')) {
function woocommerce_template_single_excerpt( $post ) {
global $post;
if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>';
}
}
View wc-disable-specific-stylesheets.php
/**
* Set WooCommerce image dimensions upon theme activation
*/
// Remove each style one by one
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss
unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout
unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation
return $enqueue_styles;
@EnterpriseBranding
EnterpriseBranding / wc-disable-default-stylesheet.php
Created Jan 7, 2019 — forked from woogists/wc-disable-default-stylesheet.php
[Theming Snippets] Disable the default stylesheet
View wc-disable-default-stylesheet.php
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
@EnterpriseBranding
EnterpriseBranding / wp-clean-admin.php
Created Jan 7, 2019 — forked from celsowhite/wp-clean-admin.php
Functions to clean admin dashboard menu and welcome screen.
View wp-clean-admin.php
<?php
/*---------------------
Dashboard Menu Adjustments
---------------------*/
// Only hide specific dashboard menu items on the live server.
// Show on localhost so we can control every component.
$whitelist = array('127.0.0.1','::1');
@EnterpriseBranding
EnterpriseBranding / force-color-scheme.php
Created Jan 3, 2019 — forked from tillkruss/force-color-scheme.php
Enforce a specific WordPress admin color scheme.
View force-color-scheme.php
<?php
add_action( 'admin_init', function() {
// remove the color scheme picker
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
// force all users to use the "Ectoplasm" color scheme
add_filter( 'get_user_option_admin_color', function() {
return 'ectoplasm';
You can’t perform that action at this time.