Forums Forums Search & Filter Pro How can I get titles from ACF post object field? (instead of IDs)

Tagged: 

Viewing 10 posts - 1 through 10 (of 47 total)
  • Anonymous
    #244975

    Hello,

    I have 2 CPTs, Instructors and Courses. I’m using ACF (plugin Version 5.8.7) and in the Courses field group, I have a Post Object field (Instructors) that is set to return a Post Object. It allows me to relate the Instructor to a Course. All that is working as expected.

    I’m using Search & Filter (plugin Version 2.5.0) to search the courses. I’m using several fields to filter the selections: course taxonomy, course post meta (art media), course post meta (instructor post-object) and date. all is working as expected except for the instructor post object. The filter is showing the post ID of the instructor, not the post title.

    On the ACF side, I’ve tried switching to a relationship field but that didn’t change the post ID output.

    On the S&F side I’ve tried using many different meta keys, to no avail. And with each iteration the cache needs to be rebuilt and it takes like 45 minutes. Very time consuming.

    Ultimately, I’d like that filter to display the instructor (lastname, firstname) all as one filter-field. These are available as custom fields in the post type. Is that possible?

    Any thoughts or insight is greatly appreciated. Thanks in advance!

    Trevor
    #244978
    This reply has been marked as private.
    Anonymous
    #244997
    This reply has been marked as private.
    Trevor
    #245120

    While I check this out, can you confirm whether or not you made the change suggested in this post:

    https://support.searchandfilter.com/forums/topic/results-not-displaying-3/#post-222308

    Anonymous
    #245139

    Trevor,

    I have not made that change to wp-config. I can confirm that I am seeing the same behavior on my local machine. (not WP engine)

    Trevor
    #245155

    I added the Instructor field to the form, after setting the field to return the Post ID (in the field group). I have installed the latest version of our plugin and then rebuilt the cache.

    For me it now works OK?

    Anonymous
    #245341
    This reply has been marked as private.
    Anonymous
    #245357

    Trevor, I also asked this question of ACF. Here is there response:

    I suspect that this is happening because the post object and the relationship field both save the post id in the database and the S&F plugin is only retrieving the saved value.
    I can suggest that you reach out to the guys over at S&F and check if they have some native functions to format the output.

    Trevor
    #245441
    This reply has been marked as private.
    Anonymous
    #245524

    Trevor, Thanks for sticking with me on this.

    I understand you can get the lastnames to show up. But notice they are all empty (ie. 0 courses). It seems that field is not being related to the Course search that is happening.

    I renamed the headings and added some screen shots to illustrate the difference.

    The post meta “instructor” is now labeled “Instructor Field Pulls ID ONLY”. Note that this is limited to the instructor IDs for the courses available. That relationship is what I want to show, but I’d like to show the instructor Name in place of the post ID. https://www.screencast.com/t/QecSCWyX5

    The post meta “last_name”, now labeled “Instructors by lastname” shows the name of the instructors, but none are related to the course search that is happening. If I check ‘Hide Empty’ the list is blank.
    https://www.screencast.com/t/Hx5WRKGzc

    I want to show the instructor names (not ids) that are related to the courses being searched.

    How can I achieve this?

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