• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add Personal Welcome Message For Logged In Members

This PHP code enables you to display a personal message to logged in members and a generic message to all non logged in members.

message

Please copy ALL the code from the view raw link in the Gist and paste it at the end of your child themes functions.php file using a text editor like Notepad++

About The Code

The above code includes the wp_head hook which executes at the top of the page and can be changed to any theme specific or WordPress hook position like loop_start or genesis_before_content.

The code uses the is_user_logged_in() conditional tag to check if the current user is logged in.

It also includes the wp_get_current_user() function to get the current user info which in the above code example is the first name.

On top of this, i’ve added a div with an existing class which you can change from entry-title to a new or existing class of your own.

The message displayed for non logged in members is not personalized.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.