Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8624

    I would like to replace the previous / next navigation at the beginning of each portfolio item with a link that points to a single page

    <a href="<?php bloginfo('url'); ?>/page-name/">Link</a> (easy and works well) and another link that points to the automatically created category page of the current portfolio item. This is what I have so far:

    <?php
    $cat_link = get_permalink($cat->ID);
    $cat_title = get_the_title($cat->ID);
    echo '<a href="'.$cat_link.'">'.$cat_title.'</a>';
    ?>

    It shows a link but this one points to the portfolio item I’m on right now. Does anyone know hoe to fix this?

    #61923

    I’d use http://codex.wordpress.org/Function_Reference/get_category_link instead of “get_permalink” for the category id.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Link from portfolio item to portfolio category’ is closed to new replies.