This file contains hidden or 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
| /*======================================= | |
| = Google Maps API = | |
| =======================================*/ | |
| var geocoder; | |
| var map; | |
| var address = location_address; | |
| function initialize() { | |
| geocoder = new google.maps.Geocoder(); |
This file contains hidden or 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
| upload_max_filesize = 64M | |
| post_max_size = 64M | |
| max_execution_time = 300 |
This file contains hidden or 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
| add_filter( 'post_thumbnail_html', 'qwp_featured_image_default', 10, 5 ); | |
| function qwp_featured_image_default($html){ | |
| $default_thumb = foundation_q_get_option('website_default_thumb'); | |
| $default_thumb_url = $default_thumb['thumbnail']; | |
| $default_thumb_id = $default_thumb['id']; | |
| if ( empty( $html ) ): | |
| $html = '<img src="' . $default_thumb_url . '" alt="" />'; | |
| endif; |
This file contains hidden or 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
| if ( is_admin() || ! $query->is_main_query() ) return; | |
| if ( in_array ( $query->get('post_type'), array('event','venue') ) ) { | |
| $query->set( 'meta_key', '_ct_selectbox_52f65ae267764' ); | |
| $query->set( 'meta_value', $city ); | |
| return; | |
| } |
This file contains hidden or 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
| function extend_date_archives_add_rewrite_rules($wp_rewrite) { | |
| $rules = array(); | |
| $structures = array( | |
| $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_date_permastruct(), | |
| $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_month_permastruct(), | |
| $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_year_permastruct(), | |
| ); | |
| foreach( $structures as $s ){ | |
| $rules += $wp_rewrite->generate_rewrite_rules($s); | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Duplicate 'the_content' filters | |
| * | |
| * @author Bill Erickson | |
| * @link http://www.billerickson.net/code/duplicate-the_content-filters/ | |
| */ | |
| global $wp_embed; | |
| add_filter( 'ea_the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
This file contains hidden or 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
| function searchfilter($query) { | |
| if ($query->is_search && !is_admin() ) { | |
| $query->set('post_type',array('post','page')); | |
| } | |
| return $query; | |
| } | |
| add_filter('pre_get_posts','searchfilter'); |
This file contains hidden or 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
| function redirect_users_by_role($redirect_to, $request, $user) { | |
| return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : home_url(); | |
| } // cm_redirect_users_by_role | |
| add_action( 'login_redirect', 'redirect_users_by_role', 10, 3 ); |
This file contains hidden or 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
| // https://gist.github.com/jlengstorf/ce2470df87fd9a892f68 | |
| function setup_theme( ) { | |
| // Theme setup code... | |
| // Filters the oEmbed process to run the responsive_embed() function | |
| add_filter('embed_oembed_html', 'responsive_embed', 10, 3); | |
| } | |
| add_action('after_setup_theme', 'setup_theme'); | |
| /** |
This file contains hidden or 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 | |
| $xml = new SimpleXMLElement('<xml/>'); | |
| for ($i = 1; $i <= 8; ++$i) { | |
| $track = $xml->addChild('track'); | |
| $track->addChild('path', "song$i.mp3"); | |
| $track->addChild('title', "Track $i - Track Title"); | |
| } |