Use custom template on certain URLs
Thanks to @Milo on the comments, I’m gonna post my answer: Firstly I added this rule: add_rewrite_rule( “en/artist/([^/]+)/?”, ‘index.php?pagename=post_type=artist&artist=$matches[1]&gal_template=en’, “top”); Then this filter: add_filter( ‘query_vars’, ‘gal_query_vars’ ); function gal_query_vars( $query_vars ) { $query_vars[] = ‘gal_template’; return $query_vars; } Finally, I filtered the single template: add_filter( ‘single_template’, ‘get_custom_post_type_template’ ); function get_custom_post_type_template($single_template) { global $post; if ($post->post_type … Read more