Home › Forums › General Issues › Custom Post Type Relationship Archive Page › Reply To: Custom Post Type Relationship Archive Page
/**
* URL Rewrite
*/
add_action( 'generate_rewrite_rules', 'custom_rewrite_rules' );
function custom_rewrite_rules()
{
// get global rules
global $wp_rewrite;
// add custom rules
$new_rules = array(
"artists/([^/]+)/works/?" => "index.php?post_type=artists&post_name=" . $wp_rewrite->preg_index(1)
);
// put custom rules into global rules
// or use array_push() ...
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
// go to settings -> permalinks to flush your rules
Check out generate_rewrite_rules
here … btw its not an issue from ACF!
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.