Support » Fixing WordPress » where does get_term_link() go to?

  • Hi, I am building a new theme for a site and I am having trouble getting one section to work properly.

    Basically I have a custom taxonomy where each term is listed on a custom page, I then am using the get_term_link() function to link to a page which displays all the posts within that term.

    The URL that is returned from that function is http://www.frictionmultimedia.com/?taxonomy=RepresentedArtist&term=fin-davies but when I click on the link it goes to “Page not found”.

    I have a page called taxonomy-representedartist.php which is where I was expecting the link to go to but obviously it doesn’t.

    What have I done to cause the link not to go anywhere? is the page named wrong or something?

    Any help is much appreciated,

    Thanks,
    Matt

Viewing 4 replies - 1 through 4 (of 4 total)
  • Without sample code, it’s hard to say. Did you check out the Codex example?

    Function Reference/get term link

    Yes I checked the Codex example, all seems fine to me.

    Here is the main section of code from the custom page that links the custom taxonomy:

    $args1 = array(
    	'taxonomy' => 'representedartist', // Registered tax name
    	'hide_empty' => false
    );	 ?>
    
     	<?php $artists = get_terms( 'representedartist', $args1 ); ?>
    
     		<?php foreach ($artists as $artist) { ?>
    			 <section class="artist">
    			 		<?php $artistName = $artist->name;
    			 				$artistID = $artist->term_id; ?>
    			 				<?php $term_link = get_term_link($artist); echo $term_link;?>
    			 		<a class="nostyle" href="<?php echo $term_link; ?>"><h2 class="artistName"><?php echo $artistName;  ?></h2></a>
    			 		<img src="<?php echo z_taxonomy_image_url($artist->term_id); ?>" width="400px" />
    			 		<p class="artistBio"><?php echo $artist->description;  ?></p>

    [Moderator Note: No bumping, thank you.]

    If no one else responds first, I’ll try and take a look when I have some time…

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘where does get_term_link() go to?’ is closed to new replies.