Hi Aleks,
I have added following snippet to fix conflixt between GeoDirectory and ACF.
/**
* Fix: GeoDirectory & ACF conflict
*/
function gd_snippet_190619_posts_where( $where, $wp_query ) {
global $wpdb;
if ( ! empty( $wp_query ) && geodir_is_geodir_page() ) {
if ( $field_key = $wp_query->get( 'acf_field_key' ) ) {
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $field_key );
}
if ( $field_name = $wp_query->get( 'acf_field_name' ) ) {
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_excerpt = %s", $field_name );
}
if ( $group_key = $wp_query->get( 'acf_group_key' ) ) {
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $group_key );
}
}
return $where;
}
function gd_snippet_190619_pre_get_posts( $wp_query ) {
if ( ! empty( $wp_query ) ) {
add_filter( 'posts_where', 'gd_snippet_190619_posts_where', 11, 2 );
}
}
add_action( 'pre_get_posts', 'gd_snippet_190619_pre_get_posts', 11, 1 );
Please check and let us know.
Kiran