Skip to content

Instantly share code, notes, and snippets.

View danieljwonder's full-sized avatar
💻

Daniel Wonder danieljwonder

💻
View GitHub Profile
// Remove WooCommerce Theme Support admin message
add_theme_support( 'woocommerce' );
@danieljwonder
danieljwonder / 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;
@danieljwonder
danieljwonder / 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 );
@danieljwonder
danieljwonder / 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' );
@danieljwonder
danieljwonder / 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' );
}
}
@danieljwonder
danieljwonder / 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
@danieljwonder
danieljwonder / 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);
@danieljwonder
danieljwonder / 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;
}
@danieljwonder
danieljwonder / functions.php
Created December 11, 2018 22:54
Enable & Customise AMP Compatibility Within WordPress Themes
<?php
// Enabled Paired Mode (Recommended)
add_theme_support( 'amp', array(
'paired' => true,
) );
// Enabled Native Mode (Less Functional)
add_theme_support( 'amp', array(
'paired' => false, // Force native mode
@danieljwonder
danieljwonder / greeter.sol
Created December 8, 2018 20:49
Ethereum Greeter Updated from v4
pragma solidity ^0.5.0;
contract mortal {
/* Define variable owner of the type address */
address owner;
/* This function is executed at initialisation and sets the owner of the contract */
constructor() public { owner = msg.sender; }
/* Function to recover the funds of the contract */