Support

Account

Home Forums General Issues Only list pages with specific value in property in relationship field Reply To: Only list pages with specific value in property in relationship field

  • There is a known problem with the relationship field and hierarchical post types. It’s not really considered a bug. When ACF gets the posts in a hierarchical post type it attempts to short them hierarchically.

    so in your condition

    
    |-type1
    |  |--type2
    |  |    |--type3
    |  |--type2
    |  |--type2
    |  |--type2
    |  |    |--type3
    |-type2
    |-type1
       |--type2
    

    the grandparent pages that are “type1” are not returned and when ACF tries to sort them since the grandparents are missing at the top level the sub pages disappear. This is not the case when all of the grandparents are all of the “type1” type because all of the “parent type2” pages are returned.

    There isn’t any way that I know of to fix this except to change a core ACF file. I put a fix for another topic here https://support.advancedcustomfields.com/forums/topic/relationship-filter-query-by-page-template/.