If you drop this line in your code, you will see all the properties of $user_blogs.
echo '<pre>'.print_r($user_blogs,true).'</pre>';
One of them is userblog_id
, so you just have to check against it before echoing the blogname.
<?php
$user_blogs = get_blogs_of_user( $user_id );
if (!$user_blogs) {
echo 'no blogs';
} else {
echo '<div><ul>';
foreach ( $user_blogs as $user_blog ) {
if ( $user_blog->userblog_id != get_current_blog_id() ) {
echo '<li>' . $user_blog->blogname . '</li>';
}
}
echo '</ul></div>';
}
Related Posts:
- get_user_meta() to Return User Meta Only for Current Blog in Multi Site
- SQL to check how many sites a user is a member of
- Get users primary blog URL in MultiSite
- Retrieve taxonomies from arbitrary site
- Display site administrator’s id by current blog id inside link
- How to store custom user data on the database?
- Query users by capability – uninstall/deactivate callback
- How is a user’s primary blog determined?
- Get post by term from custom taxonomy in another blog on the network?
- User Role is Not Specifying in WordPress Multisite?
- Solving a get_user_meta() problem in Multisite
- get_user_meta() in multiste with respect to subdomain
- Delete all user’s meta without knowing all the ‘key’
- WPMU add custom colum
- WP DB Location for “Next Post to Create” Index Value
- Get users from all/specific blog by user_role and current_user role
- How does adding custom meta to signup form work?
- Allow user to select a theme to install when they signup
- What’s the difference between get_site_option and get_blog_option?
- Basic Multisite Question – Managing Content Centrally
- multisite 404 error for subdirectory
- How to hide or remove unwanted widgets on Multisite installation?
- Is there an easy way to separate themes on network?
- How to use WordPress multisite with mixed HTTP and HTTPS sites?
- Multisite with Different Domains
- Weird Issue with load balanced WP 3.0 setup
- Removing orphan users in WordPress Multisite
- Sharding BLOGUPLOADDIR
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- Redirect to a Plugin Settings Page After Multisite Site Creation?
- Hook filter to change wp_upload_dir() path in multisite
- How does wordpress multisite manage subdomains?
- Error 101 after upgrading WordPress
- Copy posts from one blog to another in multisite environment
- SSL for mapped subdomains in multisite (no plugins)
- How to add new sites and map a custom domain in WordPress Multisite?
- 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
- Child Theme CSS Not Overriding Parent Theme In MultiSite Site
- How To Remove Dashboard Menu Items for Multisite Users?
- Can wp-cli display all users and their roles across all sites in a multisite instance?
- How do I add JavaScript that will execute on all my sites in Multisite?
- How to update_site_option for specific site within network?
- WordPress Network for regional company websites
- How to do Domain Mapping to Subdirectories?
- Why can’t I delete original user in multisite? Options for manual removal
- Stuck with WordPress Multisite Custom signup page without .htaccess modification
- Media library not loading after switching the main site of multisite
- Multisite media library uploads broken images
- Any downsides on using Multisite for many look-alike-websites?
- WordPress Images Not Showing When FTP
- How to run a subdirectory multisite install under a subdomain
- How do I list multisite users for the current site only
- Using Two Themes – One for Main Site, One for Ecommerce
- WordPress Multisite – configuring a local development copy
- Multilanguage site with two domains
- Site not found using subdomains
- Get current Blog ID in Tinymce Plugin Dialog Window in WPMU
- Grandchild themes and optimal network architecture
- Can you install / activate the multisite when the install is in a subfolder?
- Multisite – Change Add user to Blog notification email
- URL without www redirect directly with submission page – Multiwordpress install
- Going multisite with www prefix
- WordPress sub-domain multisite 505 error
- Adding hreflang to multisite with no plugin?
- Obtaining user table for one site on multisite set up
- possible to combine sites that have lots of content, into multisite?
- How to autologin users after creating a new site (multisite)? [duplicate]
- WordPress front end posting to multiple blog in multisite with advanced custom field
- WP Multisite – Additional subdomain on the site for API purposes
- Detach site from multisite (turn off multisite)
- How to wordpress multi site [closed]
- Old Website Address Still Showing
- Multisite configuration for multiple domains
- Multisite adjust uploads like (/upload/%alphanumeric_id%/%file_type%/%blog_ID%)
- How long is “as long as possible” in wp_cache_set()?
- Changing from localhost:8888 to localhost
- WordPress multilingual site to work with other plugins
- What’s the best way to get posts from one multisite blog into another?
- Error after changing multisite URL
- Rewriting request to another site
- How to migrate post media from stand-alone to multisite build
- Multi-Network without plugin
- How install wordpress in another wordpress folder?
- All Multisites are working as one site
- How to add WordPress site to multisite network when both are addon domains
- WordPress Multisite header img src is lost from staging to production
- How can I make my existing VIP theme to multisite
- Blog broken after changing Site/Home URL
- Autoblog posts in wpms(network) into main site including featured images
- Cron job disappering without notice?
- WP Multisite .htaccess interferes with cgi-bin
- Redirect all users, except network administrators, from the main site to a subsite
- Apply Lazy loading/Infinite scroll on array data
- load styles and scripts in network admin not working
- How to redirect author subdomain pages to each author pages on www
- Problem in viewing recent posts from network site to main site
- Set static page as default front page on newly created sites in multisite
- WordPress shows death white screen on multisite
- Multisite website configure Domain issue
- External rewrite rules missing in htaccess – Multisite