Support

Account

Home Forums General Issues Date format when looping authors? Reply To: Date format when looping authors?

  • Hmm, not sure how to change my code in order to use those examples.. Could you alter this code?

    <?php
    $args  = array(
    'meta_key' => 'antallningsdatum',
    'orderby' => 'meta_value_num',
    'order' => 'DESC'
    );
    $author_query = new WP_User_Query( $args );
    $authors = $author_query->get_results();
    $user_id = get_the_author_meta('ID');
    foreach( $authors as $author ):
    
    echo '<li class="anstallningsdatum">'. get_the_author_meta( 'antallningsdatum', $author->ID ).'</li>';
    
    ;?>
    <?php endforeach;?>