Skip to content

Instantly share code, notes, and snippets.

View ahaywood's full-sized avatar

Amy Haywood Dutton ahaywood

View GitHub Profile
@ahaywood
ahaywood / PHP: WP - Gravity Shortcode
Last active December 19, 2015 02:08
PHP: WP - Gravity Shortcode
<?php echo do_shortcode( '[gravityform id=1 title=false description=false ajax=true]' ); ?>
@ahaywood
ahaywood / PHP: WP - Add featured image support to theme
Last active December 19, 2015 03:38
PHP: WP - Add featured image support to theme
$(function () {
$('.bubbleInfo').each(function () {
// options
var distance = 10;
var time = 250;
var hideDelay = 500;
var hideDelayTimer = null;
// tracker
@ahaywood
ahaywood / new_gist_file
Created August 29, 2013 23:01
PHP: WP - Changing Password Protected Field
<?php
function my_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
' . __( "To view this protected post, enter the password below:" ) . '
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
</form>
';
return $o;
@ahaywood
ahaywood / new_gist_file
Created September 15, 2013 15:33
Adding Date Picker to Admin Custom Post Type This goes in function.php From http://wordpress.stackexchange.com/questions/15656/add-a-jquery-datepicker-to-custom-field-in-post-edit
// Register datepicker ui for properties
function admin_homes_for_sale_javascript(){
global $post;
if($post->post_type == 'homes-for-sale' && is_admin()) {
wp_enqueue_script('jquery-ui-datepicker', WP_CONTENT_URL . '/themes/philosophy/js/jquery-ui-datepicker.min.js');
}
}
add_action('admin_print_scripts', 'admin_homes_for_sale_javascript');
// Register ui styles for properties
<script>jQuery(document).ready(function(){jQuery( "input[name='chb_homes_for_sale_specifics_dateavail']" ).datepicker({ dateFormat: 'DD, d MM, yy', numberOfMonths: 3 }); jQuery( "#ui-datepicker-div" ).hide();});</script>
@ahaywood
ahaywood / BackTick_ACF.md
Last active August 29, 2015 13:56 — forked from JoelBesada/README.md
BackTick for Advanced Custom Fields

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@ahaywood
ahaywood / BackTick_FoundationDocs.md
Last active August 29, 2015 13:56 — forked from JoelBesada/README.md
BackTick for Zurb Foundation Documentation

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@ahaywood
ahaywood / BackTick_WP_Query.md
Last active August 29, 2015 13:56 — forked from JoelBesada/README.md
BackTick for WP Query

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@ahaywood
ahaywood / BackTick_PHPMyAdmin.md
Last active August 29, 2015 13:56 — forked from JoelBesada/README.md
BackTick for PHPMyAdmin

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.