Dear Support,
I would like to suggest that you add an option to use %portfolio-category% as a variable inside the portfolio permalink, as it is possible with general blog posts.
I have long used the following code inside functions.php to get this working. But I think it should be a default feature.
/* ADD PORTFOLIO CATEGORY SLUG
================================================== */
add_filter('post_type_link', 'swift_portfolo_permalink', 1, 3);
function swift_portfolo_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%portfolio-category%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
// Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'portfolio-category');
if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0]))
$taxonomy_slug = $terms[0]->slug;
else $taxonomy_slug = 'portfolio-category';
return str_replace('%portfolio-category%', $taxonomy_slug, $permalink);
}
Thank you for considering my suggestion.
Kind regards,
Simon