Viewing 3 replies - 1 through 3 (of 3 total)
  • @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
    }
    Thread Starter jonoman1

    (@jonoman1)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to add member number total on directory’ is closed to new replies.