0

how to add span around each author using wp_list_authors, so the result would be like this

<span class="abc">author A</span><span class="abc">author B</span>
1

If you require customized solution then you can use user query like this.

<?php

    $args  = array(
        'who' => 'authors',
        'orderby' => 'display_name'
    );

    $wp_user_query = new WP_User_Query($args);

    if ( ! empty( $wp_user_query->results ) ) {
        foreach ( $wp_user_query->results as $user ) {

            echo '<span class="abc"><a href="' . get_author_posts_url( $user->ID ) . '">' . $user->display_name . '</a></span>';

        }
    }

?>
  • 1
    If this works for you don't forget to accept the answer. :) – Robert hue Sep 10 '14 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.