• Resolved scottiescotsman

    (@scottiescotsman)


    I have a loop to list the top 10 taxonomy [directors] of my current custom post [movies] which works ok. But what I am wanting to do is have the posts hyperlinked to the appropriate link, as in taxonomy-director.php

    <p class="align_Center f_header">top 10 directors</p>
    <?php
    $term_args = array(
    'hide_empty'		=> false,
    'orderby' 			=> 'count',
    'order'				=> 'DESC',
    'number'			=> 10
    );
    $terms = get_terms( 'director', $term_args ); ?>
    <table class="postBorder" width="100%">
    <?php foreach ( $terms as $term ) { ?>
    <tr>
    <td class="align_Center">
    <a href="#"><?php echo $term->name; ?></a>&nbsp;<span style="color: white"><?php echo $term->count; ?></span>
    </td>
    </tr>
    <?php } ?>
    </table>
    <?php }; wp_reset_postdata(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter scottiescotsman

    (@scottiescotsman)

    `<a href=”<php echo get_template_directory_uri(); ?>/taxonomy-director.php?<?php echo $term->name; ?><?php echo $term->name; ?>’
    Doesn’t work 🙁

    Thread Starter scottiescotsman

    (@scottiescotsman)

    figured it out 🙂
    <a href="<?php get_template_directory_uri(); ?>/wordpress/director/<?php echo $term->slug; ?>">

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘hyperlink to a custom taxonomy.’ is closed to new replies.