WordPress.org

Forums

Co-Authors Plus
Cannot View Secondary Author Information (2 posts)

  1. sgrosvenor
    Member
    Posted 2 years ago #

    I have a page here that basically lists the users (authors), and am attempting to retrieve the pages (not posts) they are responsible for via an inner loop

    http://174.121.152.7/~rmfpc/attorneys/

    It is only however showing the pages for the first primary author and ignoring the secondaries.

    Code below

    <?php
      $authors = get_coauthor_list_main();
      if($authors)
        foreach($authors as $author_id):
        ?>
    
                      <table width="100%" border="0" class="attorneyTable">
                        <tr>
                          <td width="250" valign="top"><p class="attorneypara" style="font-size:12px;" > <strong> <?php echo  the_author_meta('display_name', $author_id);  ?><br />
                              </strong> <?php echo the_author_meta('user-title', $author_id); ?> </p>
                            <p class="attorneypara" style="font-size:12px;" >&nbsp;</p>
                            <p class="attorneypara"><a href="http://174.121.152.7/~rmfpc/author/<?php echo  $displaynicename; ?>/">View Attorney Profile >></a> </p></td>
                          <td valign="top"><?php
    $args = array(
    'tax_query' => array(
    			array(
    				'taxonomy' => 'author',
    				'field' => 'slug',
    				'terms' => the_author_meta('user_login', $author_id)
    			)),
    'post_type'=>'page',
    'authors'      => $author_id,
    'post_status'  => 'publish',
    'child_of'     => 40,
    'title_li'     => ''
    
    );
    
    $pages = get_pages($args);
    foreach ( $pages as $page ) {
    echo $page->post_title;
    }
    
    ?></td>
                        </tr>
                      </table>
                      <?php
        endforeach;
    ?>

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Can you try using the get_coauthors() function to get the co-authors of the post? You'll need to make sure it's within the loop, or that you're passing the post ID

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.