Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End where does get_term_link() go to? WORDPRESS

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #151745
    matt25
    Participant

    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

    #151750
    Alen
    Participant

    Show us the code.

    http://codex.wordpress.org/Function_Reference/get_term_link

    Look at the example section.

    #151751
    matt25
    Participant

    Hi, 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>

    #151820
    matt25
    Participant

    Can anyone tell me, what template file I need to create to find a page via this link?

    Thanks,
    Matt

    #275909
    subhasishnath45
    Participant

    It has been long since this topic was discussed but Matt did you find any solution ??? I’m stuck in the same problem.

    #276011
    matt25
    Participant

    Maye sure the file name is correct and then try clicking update permalinks in the backend of wordpress TWICE.

    Hope that helps
    Matt

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.