0
votes

I have created a custom Taxonomy called downloads_categories which works like categories and has a list of Models;

enter image description here

The taxonomy is linked to a custom post type called downloads the post type contains 2 elements/fields (the_title) and (the_field('file')).

In my template taxonomy-downloads_categories.php how do I echo all the posts which are associated to the current taxonomy term? I currently use the following code and it only echo's the 1st available download.

<a href src="<?php the_field('file'); ?>" alt="" /><?php the_title(); ?></a>
1
You need a regular wordpress loop, just like any other page - Steve
Thank you @steve sometimes I need to take a step back and take a fresh look at the basics! - Brad Fletcher

1 Answers

2
votes

To expand on my comment, you need a regular wordpress loop:

<?php if(have_posts()):while(have_posts()):the_post();?>
    <a href src="<?php the_field('file'); ?>" alt="" /><?php the_title(); ?></a>
<?php endwhile; endif;?>