Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Display post meta from search field.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Arek Zielinski
    #34929

    Hi
    How to display post meta (ACF) from search form?
    Regards

    Ross Moderator
    #34951

    Do you mean what the user has selected?

    Check: http://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/

    Thanks

    Arek Zielinski
    #34979

    Im trying something like and its not working

    <?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”);

    ?>

    Url looks like this:
    http://www.xxx.com/?_sfm_xxx&#8230;

    Ross Moderator
    #34987

    Can you send me a link?

    Thanks

    Arek Zielinski
    #34998

    Website 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
    #35186

    Hey 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

    Arek Zielinski
    #35221

    The problem is that there is no php errors 🙂

    Ross Moderator
    #35222

    And you’ve enabled WP DEBUG?

    Arek Zielinski
    #35565

    Yes. Still Nothing I don’t know why

    Ross Moderator
    #35604

    what 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

Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.