This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modify a static image slider by adding recent posts. | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
*/ | |
add_filter( 'soliloquy_output_after_container', 'jdn_soliloquy_add_custom_slides', 11, 2 ); | |
function jdn_soliloquy_add_custom_slides( $slider, $data ) { | |
global $soliloquy_data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Save latitude and longitude to fields in Gravity Form submission using Geo My WP Plugin | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
*/ | |
add_filter( 'gform_pre_submission', 'jdn_set_lat_long_values', 10, 5 ); | |
function jdn_set_lat_long_values( $form ){ | |
// find the location value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the debug settings depending on the environment | |
* | |
* Add this to your wp-config file | |
* | |
* @link http://www.paulund.co.uk/debugging-wordpress | |
*/ | |
switch( $_SERVER['SERVER_NAME']) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Obfuscate an email address php output with some CSS help | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
* Based on: | |
* @link http://perishablepress.com/best-method-for-email-obfuscation/ | |
*/ | |
// PHP Output - replace the $instance['email'] with whatever input/variable is storing your clean email address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @link http://joshuadnelson.com/user-dropdown-list-custom-notification-routing-gravity-forms/#comment-2611 | |
*/ | |
add_filter( 'gform_notification_1', 'route_user_email_notification', 10, 3 ); // replace the '_1' with your form id | |
function route_user_email_notification( $notification, $form , $entry ) { | |
$location = ''; | |
$service = ''; | |
foreach( $form['fields'] as &$field ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove metaboxes from Genesis Custom Post Type Archive Settings | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
*/ | |
add_action( 'genesis_cpt_archives_settings_metaboxes', 'jdn_remove_genesis_cpt_metabozes' ); | |
function jdn_remove_genesis_cpt_metabozes( $_genesis_cpt_settings_pagehook ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace default state names with abbreviations | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
*/ | |
add_filter('gform_address_types', 'jdn_gform_address_types', 10, 2); | |
function us_address($address_types, $form_id){ | |
$address_types['us'] = array( | |
'label' => 'United States', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add the post/page slug to the body class | |
*/ | |
add_filter( 'body_class', 'jdn_slug_body_class' ); | |
function jdn_slug_body_class( $classes ) { | |
global $post; | |
$classes[] = $post->post_name; | |
return $classes; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Variables used in this script: | |
// $summary - text title of the event | |
// $datestart - the starting date (in seconds since unix epoch) | |
// $dateend - the ending date (in seconds since unix epoch) | |
// $address - the event's address | |
// $uri - the URL of the event (add http://) | |
// $description - text description of the event | |
// $filename - the name of this file for saving (e.g. my-event-name.ics) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.gform_wrapper .ginput_complex label { | |
font-size: 14px; | |
font-style: italic; | |
color: #a1a1a1; | |
padding-left: 5px; | |
} |