Skip to main content
removed fluff fixed grammar and code indentation
Source Link
Howdy_McGee
  • 20.8k
  • 24
  • 91
  • 175

List authors for current categoryAuthors For Current Category

I'm new to WP and I want to list all unique authors that have posts in category on the pagecurrent category.

My code (location: wp-content/themes/custom-theme/category.php)

<div class="container">
                <div class="row">
                   
      <?php

                        if ( have_posts() ) : ?>
 
                 
        <?php while( have_posts() ) : the_author(); ?>
             
            <div class="col-md-2 text-center">
                            <?php the_author_meta( 'display_name', 30 ); ?>
                        </div>
                 
        <?php endwhile; ?>

                        <?php else: ?>

                            <p class="text-center">No authors</p>

                        <?php endif; ?>
             
     </div>
</div>

This is not giving expected result, can someone help me?

Thanks.

List authors for current category

I'm new to WP and I want to list all unique authors that have posts in category on the page.

My code (location: wp-content/themes/custom-theme/category.php)

<div class="container">
                <div class="row">
                        <?php

                        if ( have_posts() ) : ?>
 
                        <?php while( have_posts() ) : the_author(); ?>
                        <div class="col-md-2 text-center">
                            <?php the_author_meta( 'display_name', 30 ); ?>
                        </div>
                        <?php endwhile; ?>

                        <?php else: ?>

                            <p class="text-center">No authors</p>

                        <?php endif; ?>
                 </div>
</div>

This is not giving expected result, can someone help me?

Thanks.

List Authors For Current Category

I want to list all unique authors that have posts in the current category.

My code (location: wp-content/themes/custom-theme/category.php)

<div class="container">
    <div class="row">
     
      <?php if ( have_posts() ) : ?>
       
        <?php while( have_posts() ) : the_author(); ?>
         
            <div class="col-md-2 text-center">
                <?php the_author_meta( 'display_name', 30 ); ?>
            </div>
             
        <?php endwhile; ?>

      <?php else: ?>

        <p class="text-center">No authors</p>

      <?php endif; ?>
       
     </div>
</div>

This is not giving expected result, can someone help me?

Source Link

List authors for current category

I'm new to WP and I want to list all unique authors that have posts in category on the page.

My code (location: wp-content/themes/custom-theme/category.php)

<div class="container">
                <div class="row">
                        <?php

                        if ( have_posts() ) : ?>

                        <?php while( have_posts() ) : the_author(); ?>
                        <div class="col-md-2 text-center">
                            <?php the_author_meta( 'display_name', 30 ); ?>
                        </div>
                        <?php endwhile; ?>

                        <?php else: ?>

                            <p class="text-center">No authors</p>

                        <?php endif; ?>
                 </div>
</div>

This is not giving expected result, can someone help me?

Thanks.