Home › Forums › General Issues › ACF Relationships in Custom Post Type Permalink › Reply To: ACF Relationships in Custom Post Type Permalink
Hi,
In cases like you, unfortunately the nature of wp’s url, you gonna have to add the rewrite rule yourself.
You can have a look at add_rewrite_rule
.
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule
So, your code will look something like:
function custom_rewrite_basic() {
add_rewrite_rule('^mangas/([^/]*)/([^/]*)/?', 'index.php?chapters=$matches[2]', 'top');
}
add_action('init', 'custom_rewrite_basic');
Cheers
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.