Trying to add member number total on directory

@jonoman1

There is a missing line in the code snippet at the documentation page.

Use this code instead in the “Code Snippets” plugin:

add_action("um_members_directory_before_head","um_021422_show_total_members");
function um_021422_show_total_members(){
    ?>
    <script type="text/javascript">
    jQuery(document).on("ready",function(){
        wp.hooks.addAction( 'um_member_directory_loaded', "um", function(directory, data) {
            jQuery(".um-directory-total-members").remove();
            if( data.is_search == false ){
            jQuery(".um-member-directory-header").append("<div class='um-members-wrapper'><div class='um-directory-total-members um-members-intro'><div class='um-members-total'>Total Members: " + data.pagination.total_users + "</div></div></div>");
            }
        });

    });
    </script>
    <?php
}

Ah perfect! I should have caught that. Thanks so much, that fixed it and it’s working perfectly now.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer