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
// A jQuery plugin to enable the text ellipsis in firefox. | |
// see http://yue.st/notes/code/js/ellipsis.en.html | |
// usage: | |
// $('.elementsNeedEllipsis').ellipsis(); | |
// the elements should be block level ('display: block' or 'display: inline-block') | |
// | |
// I think you should take care of resize event by yourself, | |
// just call $('.elem').ellipsis() again after element resized. | |
$.fn.ellipsis = function () { | |
$(this).css({'white-space': 'nowrap', 'overflow': 'hidden'}); |
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
function feedFilter($query) { | |
if ($query->is_feed) { | |
add_filter('rss2_item', 'feedContentFilter'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','feedFilter'); | |
function feedContentFilter($item) { | |
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
[searchandfilter id="1428"] | |
[searchandfilter id="1428" show="results"] |
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
//detects the start of an ajax request being made | |
$(document).on("sf:ajaxstart", ".searchandfilter", function(){ | |
console.log("ajax start"); | |
}); | |
//detects when the ajax request has finished and the content has been updated | |
// - add scripts that apply to your results here | |
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ | |
console.log("ajax complete"); | |
//so load your lightbox or JS scripts here again |
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 | |
/* | |
Takes 2 paramaters - | |
$query_args - an array of query arguments - this is the same as teh `$args` variable that gets passed to to `WP_Query`- https://codex.wordpress.org/Class_Reference/WP_Query | |
$sfid - this is the numeric ID of the Search Form | |
Make sure to return $query_args after you have modified it as with all WP filters | |
*/ | |
function sf_filter_query_args( $query_args, $sfid ) { | |
//if search form ID = 225, the do something with this query |
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 this to functions.php and replace `14` with the ID of your search form | |
function search_filter_marketify_entry_before() { | |
do_action( 'search_filter_prep_query', 14 ); | |
} | |
add_action( 'marketify_entry_before', 'search_filter_marketify_entry_before' ); | |
?> |
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 | |
//grab the active query from our search form | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
?> |
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 | |
//Get a single fields values using labels | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
echo $sf_current_query->get_field_string("_sft_category"); | |
?> |
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 | |
//Get a multiple fields values by passing an array of field names | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
/* | |
* EXAMPLE 1 | |
*/ |
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 | |
//Get an array of objects containing data for the current search/filter | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
var_dump($sf_current_query->get_array()); | |
?> |
OlderNewer