Skip Navigation

[Resolved] Address Field not displaying map on back-end with Divi Theme

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 6 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#544196
Edit WRA Member ‹ Wood Recyclers Association — WordPress.png

Hi,

I'm using the Divi Theme on a project along with Types, Views & Maps. I've created a CPT called WRA Members, each member has a set of contact details and an address field which is used to populate a filterable map on the front end - hidden link

You can use the Divi Theme's Divi Builder on Pages and Posts as standard but not with CPT's unless you modify the functions.php file. When I started the project I didn't anticipate needing to use the Divi Builder on my WRA Members CPT. I have since modified functions.php so that I can use the Divi Builder. Prior to doing this, my address field was working ok and rendering a small map on the back end for each WRA member, but after using the Divi Builder on my CPT it no longer displays.

I can still use a {longitude,latitude} value and everything still works on the front end as expected, but this isn't very user friendly when adding new WRA Members. I appreciate that this is some sort of conflict between divi and types/maps but if you can help me to find some way to have both the Divi Builder in use and also have the address field work with Google Maps as it was before that would be great.

This is what I have in my functions.php file if it helps. When I remove this, the address field works ok, but then I can't use the Divi Builder...

<?php

//* Enable Divi Builder on Custom Post Types
function my_et_builder_post_types( $post_types ) {
    $post_types[] = 'wra-member';
     
    return $post_types;
}
add_filter( 'et_builder_post_types', 'my_et_builder_post_types' );

//* Add Divi Meta Box to Custom Post Types
add_action('add_meta_boxes', 'divicolt_add_meta_box');
function divicolt_add_meta_box()
{
    foreach (get_post_types() as $post_type) {
        if (post_type_supports($post_type, 'editor') and function_exists('et_single_settings_meta_box')) {
            $obj= get_post_type_object( $post_type );
            add_meta_box('et_settings_meta_box', sprintf(__('Divi %s Settings', 'Divi'), $obj->labels->singular_name), 'et_single_settings_meta_box', $post_type, 'side', 'high');
        }
    }
}

add_action('admin_head', 'divicolt_admin_js');
function divicolt_admin_js()
{
    $s = get_current_screen();
    if (!empty($s->post_type) and $s->post_type != 'page' and $s->post_type != 'post') {
        ?>
        <script>
            jQuery(function ($) {
                $('#et_pb_layout').insertAfter($('#et_pb_main_editor_wrap'));
            });
        </script>
        <?php
    }
}
#544227

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - as you confirm that when you remove the custom filters added to your functions.php file the address field works.

Could you please check first which filter causes the issue by removing one by one filter added to functions.php file and if you find that the filter is related to divi then you need to contact the divi support.

Could you please check and confirm first what code causing the issue.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.