Forums › Forums › Search & Filter Pro › Display post meta from search field.
- This topic has 9 replies, 2 voices, and was last updated 8 years, 11 months ago by Ross.
-
Ross Moderator(Private) January 21, 2016 at 5:52 pm #34951
Do you mean what the user has selected?
Check: http://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/
Thanks
Anonymous(Private) January 22, 2016 at 10:08 am #34979Im trying something like and its not working
<?php
//Get a single fields values using labels
//replace1526
with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(147)->current_query();
echo $sf_current_query->get_field_string(“_sfm_xxx”);?>
Url looks like this:
http://www.xxx.com/?_sfm_xxx…Anonymous(Private) January 22, 2016 at 1:51 pm #34998Website is actually offline.
I just put in page template:
<?php
//Get a single fields values using labels
//replace 1526 with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(147)->current_query();
echo $sf_current_query->get_field_string(“_sfm_xxx”);?>
and Its echo nothing. I’m using ACF fileds
Ross Moderator(Private) January 25, 2016 at 11:15 am #35186Hey Arek
Thats looks correct. Without being able to access the site its going to be hard to help further.
When you use this field in a search, does that work correctly?
If you check your php / errorlogs, do you see anything in there?
Thanks
Ross Moderator(Private) January 28, 2016 at 6:00 pm #35604what happens if you var_dump the array:
<?php //Get a single fields values using labels //replace 1526 with the ID of your search form global $searchandfilter; $sf_current_query = $searchandfilter->get(147)->current_query(); var_dump($sf_current_query->get_array()); ?>
CAn you paste the output here?
Thanks
-
AuthorPosts