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
/** | |
* Format a street address | |
* | |
* @param array $address Address. | |
* | |
* @return null|string | |
*/ | |
function format_address( $address ) { | |
$formatted_address = null; |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/(.*)$ | |
RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads/%1 !-f | |
RewriteRule ^wp-content/uploads/(.*)$ http://www.remotesite.com/wp-content/uploads/$1 [R=301,L] | |
</IfModule> |
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 | |
require_once('../../../wp-load.php'); //File was temporarily placed in the theme | |
define( 'WP_DEBUG_DISPLAY', true ); | |
ini_set( 'display_errors', true ); | |
$allposts = get_posts('numberposts=-1&post_type=guide&post_status=any'); //Post query | |
$keys = array('address', 'address2', 'city', 'state', 'zip'); //Add post meta keys here | |
foreach ( $keys as $key ) { | |
foreach( $allposts as $postinfo) { |
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 | |
/** | |
* Filter GF date and convert to compatible ACF date string | |
* $form['id'] is the id of the Gravity Form and $post_data['post_custom_fields']['event_date'] is the custom field | |
*/ | |
add_filter('gform_post_data', 'custom_update_gf_date', 10, 3); | |
function custom_update_gf_date($post_data, $form){ |
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 | |
$upcoming_events = date( 'Ymd', strtotime( '+30 days' ) ); // Today + 30 days. | |
$events_args = array( | |
'posts_per_page' => 10, | |
'post_type' => 'event', //Events post type | |
'post_status' => 'publish,future', //Also includes scheduled posts | |
'orderby' => 'meta_value', | |
'meta_key' => 'start_date', |
NewerOlder