-
AuthorSearch Results
-
December 10, 2015 at 10:58 pm #31935
In reply to: Different templates for different filter search
AnonymousInactiveSo I’ve been trying to pull the field name from the Active Query Object, but I’m not able to pull any of custom fields, just categories.
I’m able to get _sft_credit_card_category, but not the post_meta fields of _sfm_issuer and _sfm_credit_quality.
<?php //grab the active query from our search form global $searchandfilter; $sf_current_query = $searchandfilter->get(615)->current_query(); var_dump($sf_current_query->get_array()); echo $sf_current_query->get_field_string("_sft_credit_card_category"); echo $sf_current_query->get_field_string("_sfm_issuer"); echo $sf_current_query->get_field_string("_sfm_credit_quality"); ?>
November 24, 2015 at 5:35 pm #30635In reply to: Date not always showing
AnonymousInactiveHey Ross,
Did you try it on the results.php located in the avada theme folder /search-filter ?
I tried this again with the following two codes;
<?php
//Get an array of objects containing data for the current search/filter
//replace1526
with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(14458)->current_query();
var_dump($sf_current_query->get_array());
?>and
<?php
//Get a single fields values using labels
//replace1526
with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(14458)->current_query();
echo $sf_current_query->get_field_string(“_sft_category”);?>
Neither are able to pull the values I need.
I’d like to turn the Categories In: line to not be bulleted and be on the same line. If I can pull the category then it would be fine.
I tried the above codes at the top of the results.php and neither worked.
Any idea why ?
October 9, 2015 at 2:35 pm #26959In reply to: How to get search terms
AnonymousInactiveJust an update.
I tried to use following code but it seems that a function does not exists:<?php
//Get an array of objects containing data for the current search/filter
//replace1526
with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(1526)->current_query();
var_dump($sf_current_query->get_array());
?>ERROR: Fatal error: Call to a member function get() on a non-object in …
-
AuthorSearch Results