Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active February 1, 2018 22:32
Show Gist options
  • Save KaineLabs/5c74c6c8809509e81245278cb9691f7f to your computer and use it in GitHub Desktop.
Save KaineLabs/5c74c6c8809509e81245278cb9691f7f to your computer and use it in GitHub Desktop.
Add About Me Widget - Head Data.
/**
* Add About me Head Data.
*/
function youzer_about_me_widget_user_data() {
global $Youzer;
// Get User Dta.
$items = array(
array(
'icon' => 'calendar',
'data' => sprintf(
'Member Since %s',
date( 'Y', strtotime( yz_data( 'user_registered' ) ) )
)
),
array(
'icon' => 'map-marker',
'data' => ucfirst( $Youzer->user->location( true ) )
),
array(
'icon' => 'envelope-o',
'data' => yz_data( 'email_address' )
),
array(
'icon' => 'unlink',
'data' => yz_data( 'user_url' )
)
);
?>
<style>
.yz-aboutme-wg-userdata {
}
.yz-aboutme-wg-userdata .yz-aboutme-wg-userdata-item {
margin-bottom: 15px;
}
.yz-aboutme-wg-userdata .yz-aboutme-wg-userdata-item i {
margin-right: 8px;
}
.yz-aboutme-wg-userdata .yz-aboutme-wg-userdata-info {
font-size: 13px;
}
</style>
<div class="yz-aboutme-wg-userdata">
<?php foreach ( $items as $item ) : ?>
<?php if ( empty( $item['data'] ) ) continue; ?>
<div class="yz-aboutme-wg-userdata-item">
<i class="fa fa-<?php echo $item['icon'] ?>" aria-hidden="true"></i>
<span class="yz-aboutme-wg-userdata-info"><?php echo $item['data']; ?></span>
</div>
<?php endforeach; ?>
</div>
<?php
}
add_action( 'yz_after_about_me_widget_head', 'youzer_about_me_widget_user_data' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment