Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a few custom fields for a taxonomy "Author". The term title is the Author's last name, and one of the custom fields is his first_name. Now I need, in a post loop, to list all "Authors" of that post by their full name. How can I do this? I'm using Ultimate CMS plugin to manage taxonomy custom fields.
Just to be clear this is a post type "Academic Article" with the authors as a taxonomy. Thank you.

share|improve this question
    
You're probably not going to get many responses with a 25% accept rate, you might want to go and resolve some of those questions you asked and never answered if you can. –  m0r7if3r Feb 28 '12 at 14:43
    
:). So I see. But I just reviewed my questions and I can't really classify the answers as the solution in two of them. I wouldn't want to misguide users. –  AnaRita Feb 28 '12 at 15:54
    
So submit your own solutions to the questions so that you help the community. –  m0r7if3r Feb 28 '12 at 21:56
    
Well, I did not reach a solution myself. I just gave up and went another way. Sorry, but they really are open questions. –  AnaRita Feb 28 '12 at 22:21

2 Answers 2

up vote 1 down vote accepted

So I decided to go another way. I now have the Author's Full Name as terms in the taxonomy. For the index, for which I need to separate Last Name and First Name, I used PHP string functions.

<?php
    $taxonomy = 'autores';
    $queried_term = get_query_var($taxonomy);
    $terms = get_terms($taxonomy, 'slug='.$queried_term);

    if ($terms) {
      echo '<div id="indiceAutores-nav"></div> <div id="columns"><ul class="indiceAutores" id="indiceAutores">';
      foreach($terms as $term) {
        $names=explode(' ',$term->name);
        $lastname=array_pop($names);
        $firstname= $term->name[0];

        echo '<li><a href="'.get_term_link($term->slug, $taxonomy).'">'.$lastname .', ' .$firstname .'.</a></li>';
      }
      echo '</div></ul>';
    }
    ?>

I also added some jQuery plugins for the final iteration: http://cea.iscte.pt/cadernos/?page_id=80

share|improve this answer
    
You are aware of Falsehoods Programmers Believe About Names? –  toscho Mar 1 '12 at 20:16
    
I will take care. –  AnaRita Mar 2 '12 at 0:48

I had pretty much the same issue, which I posted on the Toolset plugin support page: http://wp-types.com/forums/topic/custom-fieldtaxonomy-for-authors-with-first-name-and-last-name/. One possibility mentioned there was implementing Author as a custom post type, with an intermediary Author-Article post type, which I considered overkill for most academic researchers' purposes.

Here's the simpler (though less elegant) solution I posted there:

There are two main goals for custom author structures in such a site:

  1. List all authors in very particular citation orders. This is to reproduce a formatted citation, and also to sort articles by author. This is accomplished with a custom field "Author list": a single-line field in the format "Lastname1, Firstname1, Firstname2 Lastname2, Firstname3 Lastname3"; use whatever citation format you wish for the author list. If you want to support multiple author list citation fields, then use multiple custom fields. (That would be a pain; in my case, just one format was enough.)

  2. Take advantage of built-in features for grouping academic articles by author. This is accomplished with a custom taxonomy (non-hierarchical, like tags) "Publication author": format "Firstname Lastname".

Whenever you need to display the author list in your desired format(s) and whenever you want to sort articles by author, you can use the "Author list" custom field(s); whenever you want to list all publications by a particular author, you can use the "Publication author" custom taxonomy.

The explode PHP solution for parsing author names works most of the time, but as you surely realize, there are always some author names that break such a formulation (e.g. a name like (Xiao Jean-Phillipe de Guzman, Jr.").

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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