Skip to content

Instantly share code, notes, and snippets.

View DavidWells's full-sized avatar
😃

David Wells DavidWells

😃
View GitHub Profile
@DavidWells
DavidWells / manual-flush-leads-mapping-transient.php
Last active August 29, 2015 13:56 — forked from anonymous/manual-flush-leads-mapping-transient.php
Manually reset lead mapping fields in WordPress Leads
/* Add to functions.php file. Refresh wordpress admin, then remove this code */
// OR run /wp-admin/?clear_lead_custom_field_cache=1 and it will flush the cache
add_action('init', 'manual_flush_inbound_form_map_transient')
if (!function_exists('manual_flush_inbound_form_map_transient')) {
// Refresh transient
function manual_flush_inbound_form_map_transient(){
delete_transient('wp-lead-fields');
}
}
@DavidWells
DavidWells / wp-query-ref.php
Last active May 21, 2021 14:55 — forked from luetkemj/wp-query-ref.php
WordPress:: WP-Query Reference
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@DavidWells
DavidWells / wordpress-set-transient.php
Last active December 21, 2015 20:29 — forked from aprakasa/gist:4264372
Wordpress loop transient
<?php
/**
* Using transients on a single loop inside WordPress
*
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/
* /
$loop = get_transient( 'loop' );
if ( false === $loop ) {
// Show the last 100 tweets from the custom post type tweets.
@DavidWells
DavidWells / Wordpress :: Add jQuery Script with enqueue
Created December 4, 2012 01:34
Wordpress :: Add jQuery Script with enqueue
/** Add jquery script for responsive slider
This is for use with a child theme!
If not use: get_template_directory_uri() instead
*/
function fws_add_the_scripts() {
wp_enqueue_script(
'custom_script',
get_stylesheet_directory_uri() . '/js/responsiveslides.min.js',
array('jquery')
);