Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter Aurore

    (@aurore888)

    Thank you again for your help.

    I just let the 5 five review you deserve. Congratulations for the work you do. I hope you will inspire many other developpers.

    I wish you a long prosperity.

    Best regards,
    Aurore

    Thread Starter Aurore

    (@aurore888)

    Thank you very much for your solution. The address is displayed in the profile header now.

    I wish you the best.

    Kind regards

    Thread Starter Aurore

    (@aurore888)

    Thank you very much for clarifying the situation.

    Before using your plugin, I was using a BuddyPress hook to display the address in the profile header but it does not work anymore with your template.

    
    function user_profile_header() {
            
        $user_id = bp_displayed_user_id();
    
        echo do_shortcode('[gmw_bp_member_location object_id="'.$user_id.'" elements="address" address_fields="city,country" no_location_message=""]');
    
    }
    add_action( 'bp_profile_header_meta', 'user_profile_header' );
    
    

    So I tried the version of your documentation but it does not work too. I can paste this code in function.php or in bp-custom.php, there is no effect.

    
    function yzc_add_profile_header_custom_meta_fields() {
        
       $user_id = bp_displayed_user_id();
    
        echo do_shortcode('[gmw_bp_member_location object_id="'.$user_id.'" elements="address" address_fields="city,country" no_location_message=""]');
    
    }
    add_action( 'yz_get_profile_header_user_meta', 'yzc_add_profile_header_custom_meta_fields' );
    

    It is usually very easy to display a field with WordPress. What’s wrong here please ?

    Thread Starter Aurore

    (@aurore888)

    Hi again,
    I confirm that WP Statistics works with the bbPress plugin. I just needed to create and save a new topic to solve my problem but the visits counter does not work with old topics. Luckily my website is brand new.
    Thank you.

    My general setting are :
    limit Js files = yes + I’ve added the page id of the new event page in the field “new event form”.
    limit css files = yes

    All other fields are left empty and it works this way even on buddypress pages.

    I forgot many jquery ui scripts for the event & booking forms, so the final code is :

    
    function my_styles_and_scripts() {
    
        // Remove Events Manager files where they are not needed
        if( !is_page( array ('events', 'locations', 'new-event') ) && !is_singular(array('event', 'location') ) && !bp_is_current_component('events') ) {
        wp_dequeue_style( 'events-manager' );
        wp_dequeue_script( 'events-manager' );
        }
        
        // Add Events Manager files on these pages
        if( is_page( array ('events', 'locations', 'new-event') ) || is_singular(array('event', 'location') ) || bp_is_current_component('events') ) {
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-autocomplete');
        wp_enqueue_script('jquery-ui-button');
        wp_enqueue_script('jquery-ui-controlgroup');
        wp_enqueue_script('jquery-ui-datepicker');
        wp_enqueue_script('jquery-ui-checkboxradio');
        wp_enqueue_script('jquery-ui-dialog');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-menu');
        wp_enqueue_script('jquery-ui-mouse');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_style( 'events-manager' );
        wp_enqueue_script( 'events-manager' );
        }
        
    }
    // 100 is the priority, please increase this number if this script do not work 
    add_action( 'wp_enqueue_scripts', 'my_styles_and_scripts', 100 );
    
    

    But I’m still working on it…

    • This reply was modified 3 years, 11 months ago by Aurore.

    @donmcmahan The link to “the page you need help with” is not accessible without password. So it’s hard to help more.

    
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
    
    

    This part of the code calls the Jquery and Jquery UI files included natively in WordPress. Here is the result I have with WordPress 5.6 :
    https://my-site.com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1
    https://my-site.com/wp-includes/js/jquery/ui/core.min.js?ver=1.12.1
    https://my-site.com/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.12.1

    The Datepicker works fine with these versions.

    Hello,

    Sorry to read this Don, I’ll do my best to help you.

    The code goes in /wp-content/themes/your-child-theme-name/functions.php.

    My previous code doesn’t work because the forum editor has replaced the symbol : ‘ by ’. Sorry I can not edit the post so I try to paste it again with more details:

    
    function my_styles_and_scripts() {
    
        // Remove Events Manager files where they are not needed
        if( !is_page( array ('events', 'locations', 'new-event') ) && !is_singular(array('event', 'location') ) && !bp_is_current_component('events') ) {
        wp_dequeue_style( 'events-manager' );
        wp_dequeue_script( 'events-manager' );
        }
        
        // Add Events Manager files on these pages
        if( is_page( array ('events', 'locations', 'new-event') ) || is_singular(array('event', 'location') ) || bp_is_current_component('events') ) {
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
        wp_enqueue_style( 'events-manager' );
        wp_enqueue_script( 'events-manager' );
        }
        
    }
    // 100 is the priority, please increase this number if this script do not work 
    add_action( 'wp_enqueue_scripts', 'my_styles_and_scripts', 100 );
    
    

    Please replace the slug of my pages by yours after if( is_page( array (‘the-slug-of-the-page’, ‘the-slug-of-the-page’, ‘the-slug-of-the-page’) )

    is_singular(array(‘event’, ‘location’)) check if this is the event or location post type.

    bp_is_current_component(‘events’) check if this is the Events BuddyPress component. So you can remove this part if you are not using the BuddyPress plugin or the Buddyboss platform.

    People who use the map will have to add more files depending on the plugin they use. It is not included in my exemple.

    Please let me know if you need more details.

    Kind regards

    Hello,
    I had the same problem today : the datepicker and the booking button were not working. I noticed that if “limit JS file loading” is set to yes, many scripts are missing even if the page id is added in “General JS” (I use extra theme).

    To solve this problem, I added this function in my child template :

    For `
    function my_styles_and_scripts() {

    // Dequeue Events Manager scripts if not needed
    if( !is_page( array (‘events’, ‘locations’, ‘new-event’) ) && !is_singular(array(‘event’, ‘location’) ) && !bp_is_current_component(‘events’) ) {
    wp_dequeue_style( ‘events-manager’ );
    wp_dequeue_script( ‘events-manager’ );
    }

    // Enqueue jquery-ui & datepicker for new events
    if( is_page( array (‘events’, ‘locations’, ‘new-event’) ) || is_singular(array(‘event’, ‘location’) ) || bp_is_current_component(‘events’) ) {
    wp_enqueue_script(‘jquery-core’);
    wp_enqueue_script(‘jquery-ui-core’);
    wp_enqueue_script(‘jquery-ui-datepicker’);
    wp_enqueue_style( ‘events-manager’ );
    wp_enqueue_script( ‘events-manager’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_styles_and_scripts’, 100 );
    `
    I Hope this will work for you too.
    Best regards

Viewing 8 replies - 16 through 23 (of 23 total)