我尝试这个来获取作者昵称:
<h2>Articoli di: <span class="nome-autore"><?php global $wpdb, $blog_id;
$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_blogs ORDER BY blog_id" ) );
foreach ($blogs as $blog){
if(wp_count_posts == 0){
switch_to_blog($blog->blog_id);} else
if(wp_count_posts > 0){
echo $curauth->nickname; }?></span></h2>
然后这是元描述:
<p>Su di me: <span class="descrizione-autore">"<?php global $wpdb, $blog_id; $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_blogs ORDER BY blog_id" ) );
foreach ($blogs as $blog){
if(wp_count_posts == 0){
switch_to_blog($blog->blog_id);} else
if(wp_count_posts > 0){
echo the_author_meta( 'description' ); ?>"</span></p>
但问题是它显示了每个 blog_id 的所有昵称和描述。如何只选择一个值进行显示?