Hello Everybody,
I ran into some trouble by creating custom permalink structures for a custom taxonomy: It breaks the permalinks for all the static pages (cantact, about me...).
What I did:
1. I changed the permalink rules in the WP-admin backend to
"/%customtax%/%category%/%postname%/"
2. and set up a hook like this (shortened):
function custom_tax_link($post_link, $id){
// modify the post_link
(...)
return str_replace('%customtax%', $taxonomy_slug, $post_link);
}
add_filter('post_link', 'custom_tax_link', 10, 3);
This works fine for all posts.. **BUT** it breaks the links for all pages.
I guess what i did wrong is setting the "%customtax%" in the WP Backend (1), but I don't know how to do this in the functions.php (?) and ONLY for posts (not pages).
How do I have to do this?
Thanks for ideas, help and infos! :-)
Mark