If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
Tagged: portfolio category
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:
$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?
I’d use http://codex.wordpress.org/Function_Reference/get_category_link instead of “get_permalink” for the category id.
The topic ‘Link from portfolio item to portfolio category’ is closed to new replies.