Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
@danielmcclure
danielmcclure / custom.css
Last active March 26, 2019 07:50
Custom Gravity Forms Checkbox & Radio Button CSS Styles
/*
* # Custom Gravity Forms Checkbox & Radio Button Styles - v.1.0
* Author: [Daniel McClure](https://www.danielmcclure.com/code/)
* License: MIT
*/
/* Base input and label configuration */
.gfield_checkbox li,
.gfield_radio li {
position: relative;
@danielmcclure
danielmcclure / functions.php
Created February 18, 2019 20:38
Disabel Jetpack Nags Inside WordPress Admin Dashboard
<?php
// Disable Jetpack Nags Inside WordPress Admin Dashboard
add_filter( 'jetpack_just_in_time_msgs', '_return_false' );
// Remove WooCommerce Theme Support admin message
add_theme_support( 'woocommerce' );
@danielmcclure
danielmcclure / background-video.css
Created January 24, 2019 01:31 — forked from mwhiteley16/background-video.css
Background Video PHP
/* ---------- 6.1 Hero Video ---------- */
.home .page-header {
padding: 24rem 0 7rem;
height: 75vh;
overflow: hidden;
}
#bgvid {
position: absolute;
top: 0;
left: 0;
@danielmcclure
danielmcclure / wp-config.php
Last active January 7, 2019 02:19
Hide Cloudflare API Key in WP Rocket
<?php
// Add the following to wp-config.php to hide the Cloudflare API Key in WP Rocket
define( 'WP_ROCKET_CF_API_KEY_HIDDEN', true );
@danielmcclure
danielmcclure / functions.php
Created December 20, 2018 23:07
Enqueue Font Awesome 5 in WordPress
<?php
// Enqueue Font Awesome 5 in WordPress
function tme_load_font_awesome() {
// You can find the current URL for the latest version here: https://fontawesome.com/start
wp_enqueue_style( 'font-awesome-free', '//use.fontawesome.com/releases/v5.6.3/css/all.css' );
}
add_action( 'wp_enqueue_scripts', 'tme_load_font_awesome' );
@danielmcclure
danielmcclure / functions.php
Created December 20, 2018 22:55
Remove Dashicons in WordPress front-end for logged out users
<?php
// Remove Dashicons in WordPress front-end for logged out users
add_action( 'wp_enqueue_scripts', 'tme_dequeue_dashicons' );
function tme_dequeue_dashicons() {
if ( ! is_user_logged_in() ) {
wp_deregister_style( 'dashicons' );
}
}
@danielmcclure
danielmcclure / wp-config.php
Created December 20, 2018 21:30
Better WordPress Error Reporting Configuration
<?php
/*
* Better WordPress Error Reporting Configuration
*
* Instructions: Add the following code to your `wp-config.php` file before the stop editing notice.
*/
// PHP Error Reporting
ini_set('log_errors', 1); // Enable PHP Error Reporting
ini_set('display_errors', 0); // Hide errors from front-end
@danielmcclure
danielmcclure / functions.php
Created December 19, 2018 20:14
Disable JetPack Callbacks to WP / Enable Dev Mode
<?php
// Disable JetPack Callbacks to WP
define( 'JETPACK_DEV_DEBUG', true);
@danielmcclure
danielmcclure / functions.php
Created December 18, 2018 03:40
Disable OptinMonster for Users With Specific Roles
<?php
// Disable OptinMonster for Users With Specific Roles
function om_docs_hide_optin_for_user_roles( $campaigns ) {
// Do nothing if no user is logged in.
if ( ! is_user_logged_in() ) {
return $campaigns;
}