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 list of product details in pdf format. There are about 300 of them, and each one is a post within a custom post type of "details".

Each post is linked to any combination of 3 taxonomies: Profile, Thickness, and Location.

Each product has a pdf file linked to it.

Users are given the opportunity to filter the list of product details via 3 select boxes that contain the various taxonomies.

So for example a customer selects "bevel", "3/8"", and "ceiling" and is presented with a table containing all products that apply:

<table>
    <tr>
        <td>Product A</td>
        <td>Bevel</td>
        <td>3/8"</td>
        <td>Ceiling</td>
        <td>Download Link</td>
    </tr>
    <tr>
        <td>Product B</td>
        <td>Bevel</td>
        <td>3/8"</td>
        <td>Ceiling</td>
        <td>Download Link</td>
    </tr>
</table>

Where the profile, thickness and location are (ideally) pulled from the taxonomies.

So far, my ajax looks like the following ($profile, $thickness and $location are returned from the filter form and the value is the correct taxonomy slug) and functions as it should, I can select different options and return only the proper results to the table:

<?php
    $args = array(
        'post_type' => 'details',
        'posts_per_page' => 50,
        'edge_profile' => $profile,
        'overall_thickness' => $thickness,
        'location' => $location
    );
    $posts = get_posts($args);
    foreach($posts as $post):setup_postdata($post);
?>
<tr>
    <td><?php the_title(); ?></td>
    <td></td>
    <td></td>
    <td></td>
    <td><?php the_content(); ?>
</tr>
<?php
    endforeach;
    wp_reset_postdata();
?>

Where I'm having a problem is with those three blank td's up there where I should be displaying a profile name, a thickness name, and a location name.

I've tried multiple solutions and just can't seem to find the right one. I'm hoping someone here can help me out.

Thank you in advance.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Since individual entries in taxonomies are terms, the template tag for displaying them, used between the_title() and the_content() hint-hint, would be the_terms() :)

share|improve this answer
    
That did it. Thank you! –  Rob Apr 13 at 21:29

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.