How to output name & email of site admin
-
I’m not a coder so please be patient LOL.
So I setup MU and have a form where users can create sites with a few default pages and theme in their new site.
I wanted to out put some of their info on the contact or about us pages so trying to figure that out. So from the help docs I created the below code which outputs the name & email & website of the current logged in user.
However, that was a bad idea as non-logged users see nothing.
So what could I use so that it gets the current info from the site or the site admin instead of the current user so the info can be displayed to everyone? Or what would be the best way do that? THX!!<?php $current_user = wp_get_current_user(); /** * @example Safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof WP_User) ) * return; */ echo '<span class="cpage">Name: <span style="margin-right:8px;"> ' . $current_user->user_firstname . '</span>' . $current_user->user_lastname . '</span><br />'; echo '<span class="cpage">Email: ' . $current_user->user_email . '</span><br />'; ?> <?php $user_id = 1; $user_blogs = get_blogs_of_user( $user_id ); foreach ($user_blogs AS $user_blog) { } echo '<span class="cpage">Web Site: '.$user_blog->siteurl.'</span><br>'; ?> </div>
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘How to output name & email of site admin’ is closed to new replies.