Forums › Forums › Search & Filter Pro › Display search terms other than category do not work
Tagged: search terms
- This topic has 4 replies, 2 voices, and was last updated 9 years, 6 months ago by
Ross.
-
Ross Moderator(Private) March 7, 2016 at 10:15 am #38801
Have you tried to get the array of values:
?
Can you try to do this and do a
var_dump
of the result, and then past teh contents here?Thanks
Anonymous(Private) March 17, 2016 at 5:08 pm #39701Hi!
Sorry for my late reply but I had to complete another project..
If I do a var_dump I get the following:
array(2) { [“authors”]=> array(5) { [“name”]=> string(7) “Authors” [“singular_name”]=> string(6) “Author” [“all_items_label”]=> string(11) “All Authors” [“type”]=> string(9) “post_type” [“active_terms”]=> array(1) { [0]=> array(3) { [“id”]=> int(39) [“name”]=> string(7) “Agenzie” [“value”]=> string(7) “agenzie” } } } [“_sf_post_date”]=> array(1) { [“active_terms”]=> array(2) { [0]=> array(1) { [“value”]=> string(8) “01032016” } [1]=> array(1) { [“value”]=> string(8) “16032016” } } } }In my form I have Authors (in this example value for that is “Agenzie”) and Post Date range fields.
I am not expert in PHP…can you help me to get the authors and post date range?
As $sf_current_query->get_field_string(“authors”) does not work.Thanks
Anonymous(Private) March 17, 2016 at 5:54 pm #39703I finally found this solution:
$sarr = $sf_current_query->get_array();
$author = $sarr[authors][active_terms][0][name] ;
$fromDate = $sarr[_sf_post_date][active_terms][0][value] ;
$toDate = $sarr[_sf_post_date][active_terms][1][value];I hope it keeps on working always!
Ross Moderator(Private) March 17, 2016 at 11:50 pm #39736Thanks for the update, and glad you’ve got it working.
-
AuthorPosts