Tell me more ×
WordPress Answers 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

1 Answer

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

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.