Hi,
You will need to copy the template file from wp-content/plugins/a-z-listing/templates/a-z-listing.php
into your theme at the root folder e.g. wp-content/themes/your-theme/a-z-listing.php
. Once you’ve copied the template you can customise to suit. I haven’t checked whether you need the WP_Post object loaded, but if it isn’t needed I believe the following modification to lines 57-59 will do the job:
<a href="<?php $a_z_query->the_permalink(); ?>">
<?php $a_z_query->the_title(); ?>
</a>
<?php the_terms( $a_z_query->get_the_item_id(), 'year', '(', ', ', ')' ); ?>
This will print the terms linked to their own page (according to the ‘the_terms’ documentation). An alternative, if you want the terms linked to the post is to use get_the_terms
, which returns an array that you’ll need to iterate over to build the list. You can then place the output either inside the <a>
to link the whole list to the post, or after the <a>
to leave the list unlinked:
<a href="<?php $a_z_query->the_permalink(); ?>">
<?php $a_z_query->the_title(); ?>
</a>
<?php
$terms = get_the_terms( $a_z_query->get_the_item_id(), 'year', '(', ', ', ')' );
if ( ! empty( $terms ) ) {
print '(';
$first_iteration = true;
foreach ( $terms as $term ) {
if ( $first_iteration ) {
$first_iteration = false;
} else {
print ', ';
}
print $term->term_name;
}
print ')';
}
?>