I’m trying load a style sheet is a user role is subscriber, what am I doing wrong:

global $current_user; 
if ( user_can( $current_user, "subscriber" ) ){ 
echo '<link rel="stylesheet" href="/login/subscriber-style.css">'

This is in the header.php of the theme

Read more here: Load CSS for User role subscriber (WordPress)


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: