Display site description instead of site name
I'm wondering how to display all the network sites in WP Multisite by displaying site description instead of site name. Below is the code provided by the expert in WP in this community. It's now displaying site name. What code should I change in order to make the list displaying all the sites with site description?
function wpse365255_print_sites() {
$args = array(
'number' = 10000, // if you've got more than 10,000 sites,
//you can increase this
'public' = 1,
'spam' = 0,
'deleted' = 0,
'archived' = 0,
'site__not_in' = array( 1, 2 ),
// this will exclude sites with ID 1 and 2
);
$sites = get_sites( $args ); // will return an array of WP_Site objects
$list = '';
foreach ( $sites as $site ) {
$details = get_blog_details( $site-blog_id );
if ( ! empty( $details ) ) {
$list .= 'li';
$list .= 'a href="' . $details-siteurl . '"';
$list .= $details-blogname;
$list .= '/a';
$list .= '/li';
}
}
if ( ! empty( $list ) ) {
echo 'ul' . $list . '/ul';
}
}
I tried to change the blogname
to blogdescription
but the site description not showing up. I look forward to answers from the experts here. Thank you!
Topic description multisite Wordpress
Category Web