• Resolved gwab

    (@gwab)


    Hi. First of all, awesome plugin. Works great. I am running a website with Ultimate Member and WpDiscuz which allows users to select a role during registration. On Wpdiscuz, there is the option to display different colors depending on the user’s role. I have been trying to place a similar function in the Ultimate Member profiles that changes the color of the user’s name in the header to their corresponding role color and display a specific image underneath their name. I tried searching for UM and WpDiscuz hooks designed for this but found none so I have been attempting to use the following code in my theme’s functions.php file but without any luck:

    add_action( 'um_after_profile_header_name_args', 'my_after_profile_header_name_args', 10, 1 );
    function my_after_profile_header_name_args( $args ) {
    
    $user = new WP_User( $user_id );
    $user_roles = $user->roles;
    $user_role = array_shift($user_roles);
    
        if (in_array("um_rank1", $user_roles)) {
    		
            ?>
    
    <div align="center">
    <img src="../images/misc/rank1.png" width="250px">
    </div>
    
        <?php
        } elseif (in_array("um_rank2", $user_roles)) {
        ?>
    
    <div align="center">
    <img src="../images/misc/rank2.png" width="250px">
    </div>
    
        <?php
        } elseif (in_array("um_rank3", $user_roles)) {
        ?>
    
    <div align="center">
    <img src="../images/misc/rank3.png" width="250px">
    </div>
    
    
    		
        <?php
        }
    }

    If there is a specific block of code from WpDiscuz that can achieve this or any step in the right direction is greatly appreciated. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi,

    We’re really sorry, but there is not an easy solution we can share here.

    Currently, we have plugin customization and custom addon development services at the gVectors Team. They can assess the work and create it for you. Just contact us via sales[at]gvectors.com?email address and send a list of requirements you’d like to have.

    Thread Starter gwab

    (@gwab)

    I have actually found a solution. Nonetheless, thank you for the reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Role Colors’ is closed to new replies.