Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / custom-provision.sh
Created July 13, 2015 02:58
Custom VVV Variable Provisioning for WordPress sites
# #!/bin/bash
# #
# # provision.sh
# #
# # This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# # provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# # or `vagrant reload` are used. It provides all of the default packages and
# # configurations included with Varying Vagrant Vagrants.
# # By storing the date now, we can calculate the duration of provisioning at the
@neilgee
neilgee / git.css
Last active December 7, 2023 02:08
Git Command Line Reference - Notes, Cheatsheet and reminders on Git set up and commands
/*
* Set up your Git configuration
*/
git config --global user.email "you@yourdomain.com"
git config --global user.name "Your Name"
git config --global core.editor "nano"
@neilgee
neilgee / style.css
Last active September 30, 2023 05:46
CSS Teaks for WP Google Review Slider
/* Testimonials
--------------------------------------------- */
/* Google Review Plugin Swap #32407b and #fff for your colors */
@media(min-width:768px) {
/* Testimonials Equal Height*/
.wprevpro_t1_outer_div {
display: flex;
@neilgee
neilgee / acf-rs2.php
Last active July 11, 2023 03:13
Relationship Field ACF as Shortcode
<?php //<~ don't add me in
add_shortcode( 'tl_related_lights', 'tl_related_lights_relationship' ); // Add your shortcode here
// Add Relationship field between same CPT
function tl_related_lights_relationship() {
ob_start();
$posts = get_field('relationship_field_name'); // Add your ACF field in here
@neilgee
neilgee / functions.php
Last active July 5, 2023 03:41
gridbuilderWP with PowerPack Off-Canvas Menu - auto close menu on facet refresh/change
<?php ~> don't add me / this function calls the script.js
add_filter( 'wp_grid_builder/frontend/register_scripts', 'prefix_register_script' );
//gridbuilder external js script
function prefix_register_script( $scripts ) {
$scripts[] = [
'handle' => 'global',
'source' => '/wp-content/themes/mytheme/js/script.js',
@neilgee
neilgee / cloudflare.cnf
Created March 31, 2021 02:20
Cloudflare Conf - Fail2Ban
#
# Author: Mike Rushton
#
# IMPORTANT
#
# Please set jail.local's permission to 640 because it contains your CF API key.
#
# This action depends on curl (and optionally jq).
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
#
@neilgee
neilgee / allowedtags.php
Last active April 1, 2023 05:08
Add back in HTML Tag Suggestions to Comments in WordPress
<?php //<~ don't add me in
add_action('init', 'wpb_allowedtags_comments', 10);
function wpb_allowedtags_comments() {
define('CUSTOM_TAGS', true);
global $allowedtags;
$allowedtags = array(
'a' => array(
@neilgee
neilgee / remove-password-strength.php
Last active March 15, 2023 11:51 — forked from WPprodigy/functions.php
Remove the password strength meter from WooCommerce checkout
add_action( 'wp_print_scripts', 'themeprefix_remove_password_strength', 100 );
// Remove password strength script
function themeprefix_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
@neilgee
neilgee / checkbox-metabox.php
Created July 16, 2017 07:01
WordPress Checkbox Metabox in Post Editor Screen - Added as a Plugin
<?php
/*
Plugin Name: Checkbox Meta
Plugin URI: http://wpbeaches.com/
Description: Checkbox Test
Author: Neil Gee
Version: 1.0.0
Author URI: http://wpbeaches.com
License: GPL-2.0+
@neilgee
neilgee / inline-css-wordpress.php
Last active February 15, 2023 18:41
WordPress how to pass Inline CSS to existing plugin or theme
<?php
//Adding CSS inline style to an existing CSS stylesheet
function wpb_add_inline_css() {
//All the user input CSS settings as set in the plugin settings
$slicknav_custom_css = "
@media screen and (max-width: {$ng_slicknav_width}px) {
{$ng_slicknav_menu} {
display: none;