Add a custum post type for testimonails in WordPress.
This includes Advanced Custom Fields field groups for some extra fields.
Create a directory to store all files.
jQuery(document).ready(function($) { | |
// If a copy clickable input is clicked | |
// input value will be highlighted and copied to clipboard | |
$('body').on('click', 'input.js-click-to-copy-input', function(e) { | |
copy_input( this ); | |
}); | |
// If a button to copy an input is clicked | |
// associated input value will be highlighted and copied to clipboard | |
$('body').on('click', 'a.js-click-to-copy-link', function(e) { |
import { cookies } from './lib/cookies'; | |
import modal from './lib/modal'; | |
$(document).ready(function() { | |
modal(cookies); | |
}); |
import { helloWorld } from './lib/hello-world'; | |
import sayHello from './lib/say-hello'; | |
$(document).ready(function() { | |
sayHello(helloWorld); | |
// Hello Friend | |
}); |
<?php | |
/** | |
* Detect if localhost | |
* | |
* @return true if using localhost | |
*/ | |
function is_localhost() { | |
$whitelist = array( '127.0.0.1', '::1' ); | |
if( in_array( $_SERVER['REMOTE_ADDR'], $whitelist) ) { | |
return true; |
This is for when you use the WordPress Plugin Boilerplate generator as starter for a WordPress plugin.
This is a way to get Sass set up and have Javascript use module dependency with webpack as the module bundler.
Follow the steps below to get started.
<?php | |
function list_thumbnail_sizes($type = 'all', $name = '') { | |
global $_wp_additional_image_sizes; | |
$sizes = array(); | |
$rSizes = array(); | |
foreach (get_intermediate_image_sizes() as $s) { | |
$sizes[$s] = array(0, 0); | |
if (in_array($s, array('thumbnail', 'medium', 'large'))) { | |
$sizes[$s][0] = get_option($s . '_size_w'); | |
$sizes[$s][1] = get_option($s . '_size_h'); |
<?php | |
/** | |
* Plugin Name: Convert ACF PHP to JSON | |
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
*/ | |
namespace ConvertAcfPhpToJson; | |
/** | |
* Add submenu item under 'Custom Fields' |
This gist shows how you can add your own custom colors to the Zurb Foundation color palette.
They new colors can then be used to create custom buttons. The color sass variable is also avaliable using the get-color()
function.
The library can be installed from here [https://github.com/dimsemenov/Magnific-Popup].
via Bower bower install magnific-popup --save