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
add_filter('posts_clauses', 'posts_clauses_with_tax', 10, 2); | |
function posts_clauses_with_tax( $clauses, $wp_query ) { | |
global $wpdb; | |
//array of sortable taxonomies | |
$taxonomies = array('example-taxonomy', 'other-taxonomy'); | |
if (isset($wp_query->query['orderby']) && in_array($wp_query->query['orderby'], $taxonomies)) { | |
$clauses['join'] .= " | |
LEFT OUTER JOIN {$wpdb->term_relationships} AS rel2 ON {$wpdb->posts}.ID = rel2.object_id | |
LEFT OUTER JOIN {$wpdb->term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id | |
LEFT OUTER JOIN {$wpdb->terms} USING (term_id) |
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 | |
/* | |
Plugin Name: Gravity Forms Fields Above | |
Plugin URI: https://gist.github.com/webaware/24e1bacb47b76a6aee7f | |
Description: move field labels from below to above fields in compound fields (e.g. Address, Name) | |
Version: 1 | |
Author: WebAware | |
Author URI: http://webaware.com.au/ | |
@link http://www.gravityhelp.com/forums/topic/change-position-of-sub-labels-on-advanced-fields |
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 | |
//----------------------------------------------------------/ | |
// responsive images [ 1) add img-responsive class 2) remove dimensions ] | |
//----------------------------------------------------------/ | |
function bootstrap_responsive_images( $html ){ | |
$classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link' | |
// check if there are already classes assigned to the anchor | |
if ( preg_match('/<img.*? class="/', $html) ) { |
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
var docElm = document.documentElement; | |
if (docElm.requestFullscreen) { | |
docElm.requestFullscreen(); | |
} | |
else if (docElm.mozRequestFullScreen) { | |
docElm.mozRequestFullScreen(); | |
} | |
else if (docElm.webkitRequestFullScreen) { | |
docElm.webkitRequestFullScreen(); | |
} |