I use WordPress Multisite and in the sidebar i have a box that shows a list of blogs the logged in user is a member of.

I'm looking for a way to exclude the mainblog from this list.
The main blog ID is 1

Here is parts of the code I use:

<?php // Gets user-info ?>
<?php global $current_user; get_currentuserinfo(); 
     $user_info = get_userdata(1); 
     $user_id = $current_user->ID; 
?> 

<?php // start the loop ?>
<?php $user_blogs = get_blogs_of_user( $user_id ); echo '<div>'; foreach ($user_blogs AS $user_blog) { echo '';?>

<?php // lists user blogs ?>
<?php echo ''.$user_blog->blogname.' '; ?>

Can anyone help me? :)

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top