WordPress.org

Forums

How to use global variables in a post? (2 posts)

  1. vnmember
    Member
    Posted 3 years ago #

    As the title has mentioned, I would like to ask how to use global variables in a post? For example, I want to creat a welcome page for the users after they login and I want to place greet to them with their username at the welcome. To me, it should be: "Hello vnmember, welcome back to WordPress.org". Any solution for this? Many thanks

  2. YouON
    Member
    Posted 3 years ago #

    <?php global $user_ID, $user_identity, $user_level ?>
    <?php if ( $user_ID ) : ?>
    Welcome, <?php echo $user_identity ?>.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.