I have a page called "cars" with child pages for each individual car

eg (site.com/cars/ferrari)

I have created a taxonomy called 'vehicle' where each term has a car that matches the child page.


When I tag posts and custom post types with this taxonomy, I would like the link to forward to the car page instead of showing an archive page.

Is there an easy way to do this? Possibly via rewrite?

  • Just FYI I know it's possible to do this manually via .htaccess but I was wondering if I could do this automatically for each new page and taxonomy I add... ? Aug 13, 2015 at 13:12

1 Answer 1


Personally I would not recommend breaking the taxonomy archives - what if someone wants to browse all posts tagged "ferrari"?

You're better off using the page URL in the first place:

if ( $tags = get_the_terms( $post, 'vehicle' ) ) {
    foreach ( $tags as $tag ) {
        if ( $_page = get_page_by_path( "cars/$tag->slug" ) )
            printf( '<a href="%s">%s</a>', get_permalink( $_page ), get_the_title( $_page ) );
  • Probably should have mentioned I'm using the Genesis framework, I'm using a specific meta filter function to add the taxonomy to each CPT and posts so it's trickier for me to add a page URL to the template in the method you described above. On the page 'ferrari' I plan to have a list of the posts and CPTs connected to the car in 3 individual lists (no pagination) so I don't think I will require taxonomy archives... Aug 13, 2015 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.