Title: Display WP function with CSS style
Last modified: August 20, 2016

---

# Display WP function with CSS style

 *  [hoofedcracker](https://wordpress.org/support/users/hoofedcracker/)
 * (@hoofedcracker)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/display-wp-function-with-css-style/)
 * Hi Guys,
    Got some PHP here that I need some input for; Here is just a rough 
   idea of what I am getting at:
 * `<style>.first:first-letter{text-transform: uppercase;}</style>`
 *     ```
       <?php
        if (is_user_logged_in() ) {
          $user = wp_get_current_user();
          echo 'Hi <span class="first">' . $user->display_name . '</span>!';
        } else{
          echo 'Hi Guest!';
        }
       ?>
       ```
   
 * I am not getting any results with the styling. i.e First letter of $user->display_name
   will not be transformed with a Capital Letter at the start.
 * I will be needing to edit some WP function i.e. display_name() or wp_get_current_user(),
   Would that be correct? If so, could you provide me with the file_name.php to 
   edit?
 * BTW, We are allowed to post up to 10 lines of code in the forums, correct? : )
 * Thank you in advance!
 * Cheers!

Viewing 1 replies (of 1 total)

 *  [petyata](https://wordpress.org/support/users/petyata/)
 * (@petyata)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/display-wp-function-with-css-style/#post-3438421)
 * You missed a part in the code, however helped me to solve this issue by myself:).
   Here is my code, adjust it appropriately:
 *     ```
       <?php
          if (is_user_logged_in() ) {
       	wp_get_current_user();
       	$current_user = wp_get_current_user();
       	 	if ( !($current_user instanceof WP_User) )
       	    	return;
       	   	echo 'You are currently logged in as <span id="user-loged-name">' . $current_user->user_login . '</span><br />';
       		 wp_loginout( home_url()); // Display "Log Out" link.
       	}
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Display WP function with CSS style’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [display_name](https://wordpress.org/support/topic-tag/display_name/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wp function](https://wordpress.org/support/topic-tag/wp-function/)
 * [wp_get_current_user](https://wordpress.org/support/topic-tag/wp_get_current_user/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [petyata](https://wordpress.org/support/users/petyata/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/display-wp-function-with-css-style/#post-3438421)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
