Skip to content

Instantly share code, notes, and snippets.

View Jonnyauk's full-sized avatar
🎯
Focusing

Jonny Allbut Jonnyauk

🎯
Focusing
View GitHub Profile
/*
Gravity Forms can be hard to override core CSS - the selectors are too specific.
Use 'form' or even 'body' to get more specific tageting/override.
*/
/* Targeting example 1 - note 'form' selector to make more specific (not used in core GF CSS) */
form div.gform_footer.top_label {
/**/
}
@Jonnyauk
Jonnyauk / customizer.php
Created May 13, 2017 13:06
Customizer functionality example
<?php
/**
* Customizer functionality example
*/
/**
*
* We include all panels, settings and controls in this one function
*
@Jonnyauk
Jonnyauk / customizer.js
Created May 13, 2017 13:05
Customizer live update example
( function( $ ) {
// CLEAN UP DATA
// Allow basic text and certain symbols
function js_clean_text( input ) {
return input.replace(/[^a-zA-Z0-9 " ' , . ! ? @ £ % & ( ) * - ]/g,'');
}
wp.customize( 'opt_link_colour', function( value ) {
function moomin2(){
$mypost = $post_ID = $p = (int) $_GET['post'];
//$target_id = wp_get_post_parent_id( get_the_ID() );
// Lets see if we have child pages to show
$p_child_args = array(
'parent' => intval( $mypost ),
@Jonnyauk
Jonnyauk / typography-test.htm
Created April 29, 2016 09:34
Useful when building a typography size stack
<h1>h1 title style</h1>
<h2>h2 title style</h2>
<h3>h3 title style</h3>
<h4>h4 title style</h4>
<h5>h5 title style</h5>
<h6>h6 title style</h6>
<h1>h1 title here, lets just check multi-line support and leading/spacing thanks to make sure we are good!h1 title here, lets just check multi-line support and leading/spacing thanks to make sure we are good!</h1>
Donec sed odio dui. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Vivamus sagittis lacu eu leo. Donec id elit non mi porta gravida at eget metus. Sed posuere consectetur est at lobortis.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Cras mattis consectetur purus sit amet fermentum. Nullam id dolor id nibh ultricies vehicula.
<?php
/**
* BRIEF DESCRIPTION OF FUNCTIONALITY
*
* @package PACKAGE NAME
*/
/*
@Jonnyauk
Jonnyauk / remove_core_emoji.php
Last active August 29, 2015 14:20
Remove crazy WordPress 4.2 Emoji support
<?php
/**
* Remove crazy WordPress 4.2 Emoji junk
*/
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
?>
@Jonnyauk
Jonnyauk / gist:94c2cc4fbdcffc378651
Created February 7, 2015 00:24
Empty menu callback
<?php
/*
NOTE: Insert into template file as usual but use fallback_cb parameter - same name as function
wp_nav_menu( array(
'container_class' => 'primary-navigation clearfix',
'theme_location' => 'primary-nav',
'fallback_cb' => 'mywfx_empty_menu'
) );
*/
@Jonnyauk
Jonnyauk / gist:4cde7d870791a4493b1a
Created February 7, 2015 00:10
Using WordPress _n
<?php
$my_value = 5;
printf( _n( 'Counting just 1 time', 'Counting %s times, whoot!', $my_value, 'mytheme' ), $my_value );
?>
@Jonnyauk
Jonnyauk / gist:0720b69d73acf55418b6
Created February 7, 2015 00:01
Debug function from Wonderflux
<?php
/**
* Displays input in a nicer way for debugging
* Only displays for top level site admin by default
* Part of the Wonderflux theme framework
*
* @param string $input The content you wish to debug - a variable or function.
* @param string $admin_only Only display to top level site admin not other users. Default=true
* @param bool $role Only display to supplied WordPress role. Default = ''
* @param integer $id Only display to supplied user ID. Default = ''