I found out it is this rule that makes the problem. How can I get it to work again?
First use custom rule like
/galleri/%portfolio-category%/
and put this code functions.php at end of file
function brand_permalink($permalink, $post_id, $leavename) {
//con %brand% catturo il rewrite del Custom Post Type
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);
}
Best regards
Morten