Latest Tech and Tips

How to Get Logged-in User’s Info in WordPress for Personalized Results


Recently we revealed you how to produce a personalized experience for your customers by permitting them conserve their preferred messages in a personalized collection. You can take personalized results to an additional degree by utilizing their given name at areas (i.e the welcome display). Luckily, WordPress makes it truly simple to get the logged-in individual’s details. In this post we will certainly reveal you how to fetch details relating to the presently logged in individual.

We will certainly use get_currentuserinfo(); feature. This might be utilized anywhere in your motif (header, footer, sidebar, page-template etc). In order for this to function the individual needs to be logged-in So we will certainly require to utilize the conditional declaration is_user_logged_in(). Example code: