Skip to content

Instantly share code, notes, and snippets.

View curtismchale's full-sized avatar

Curtis McHale curtismchale

View GitHub Profile
@curtismchale
curtismchale / fitlered-searchform.php
Created September 5, 2011 22:04
gives the user more options to filter the site by (like meta values)
<form method="get" id="searchform" action="<?php echo home_url(); ?>/">
<label class="hidden" for="s"><?php _e('', 'comienzo'); ?></label>
<input type="search" class="text" value="search site" name="s" id="s" />
<select name="sport">
<option value="" />Choose sport</option>
<?php
$metakey = 'sfn_tan_choose_sport';
$sports = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_value ASC", $metakey) );
if ($sports) {
@curtismchale
curtismchale / search-filtering.php
Created September 5, 2011 22:03
Takes the results of a search query and runs a bunch of filters on it
<?php
function tan_athlete_search_page(){
if( isset($_GET['sport']) ) {
$sport = $_GET['sport'];
$sportquery = array( 'key' => 'sfn_tan_choose_sport', 'compare' => 'like', 'value' => $sport );
} else {
$sportquery = '';
}
@curtismchale
curtismchale / populate-dropdown.php
Created August 31, 2011 05:06
Populates GF dropdown
/*
* Load any taxonomy terms
*/
function load_cpt_choices($post_type, $type, $first_choice = '', $term) {
$choices = array();
if ($type === 'select') {
$posts = get_posts('post_type='.$post_type.'&numberposts=-1&school_type='.$term);
}
@curtismchale
curtismchale / show-post-relations-relations-post-type
Created August 25, 2011 23:24
Shows the related content on a WordPress site using Relations post type
function tan_show_related_content( $postid, $post_type ) {
global $wp_query, $post;
// Related IDs for this view ?
$ids = rpt_get_object_relation( $postid, $post_type );
if( $ids == false || empty($ids) )
return false;
$items_query = new WP_Query( array(
'post__in' => $ids,
config/app_config.yml
config/database.yml
config/*.sphinx.conf
config/s3_credentials.yml
*~
*.cache
*.log
*.pid
tmp/**/*
.DS_Store