// jQuery
$(document).ready(function() {
// code
})
/* ============================================================================= | |
WordPress WYSIWYG Editor Styles | |
========================================================================== */ | |
.entry-content img { | |
margin: 0 0 1.5em 0; | |
max-width: 100%; | |
height: auto; | |
} | |
.alignleft, img.alignleft { |
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
#!/bin/bash | |
# Functions ============================================== | |
# return 1 if global command line program installed, else 0 | |
# example | |
# echo "node: $(program_is_installed node)" | |
function program_is_installed { | |
# set to 1 initially | |
local return_=1 |
This snippet has been moved to the CMB2 Snippet Library.
#301 Redirect Local Images to Live | |
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1 |
function Selector_Cache() { | |
var collection = {}; | |
function get_from_cache( selector, reset ) { | |
if ( undefined === collection[ selector ] || true === reset ) { | |
collection[ selector ] = jQuery( selector ); | |
} | |
return collection[ selector ]; | |
} |
<?php | |
// Include tlc lib | |
require_once WPMU_PLUGIN_DIR . '/wp-tlc-transients/tlc-transients.php'; | |
/** | |
* Use in place of `get_posts` | |
* | |
* @param array $args Array of get_posts arguments | |
* @param integer $time Amount of time before cache expires |
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |