Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Storefront top bar welcome message
* Adds a top bar to Storefront, before the header.
function storefront_add_topbar() {
global $current_user;
if ( ! empty( $current_user->user_firstname ) ) {
$user = $current_user->user_firstname;
} else {
$user = __( 'guest', 'storefront-child' );
<div id="topbar">
<div class="col-full">
<p>Welcome <?php echo $user ?>!</p>
add_action( 'storefront_before_header', 'storefront_add_topbar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.