- This topic is empty.
-
AuthorPosts
-
September 30, 2013 at 4:55 pm #151745matt25Participant
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,
MattSeptember 30, 2013 at 5:34 pm #151750AlenParticipantShow us the code.
http://codex.wordpress.org/Function_Reference/get_term_link
Look at the example section.
September 30, 2013 at 5:35 pm #151751matt25ParticipantHi, Thanks, I have looked at the codex, everything 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>October 1, 2013 at 11:05 am #151820matt25ParticipantCan anyone tell me, what template file I need to create to find a page via this link?
Thanks,
MattSeptember 4, 2018 at 2:36 am #275909subhasishnath45ParticipantIt has been long since this topic was discussed but Matt did you find any solution ??? I’m stuck in the same problem.
September 6, 2018 at 4:43 am #276011matt25ParticipantMaye sure the file name is correct and then try clicking update permalinks in the backend of wordpress TWICE.
Hope that helps
Matt -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.