Redirecting Post to its Term
I am trying to redirect post to its term (in custom post type).
I tried following in single-[post-type] “
<?php $taxonomy= 'resource-list'; $terms = get_the_terms( $post->ID, $taxonomy ); $term_id = $terms->term_id; $relocate = get_term_link($term_id); header("Location:" .$relocate); ?>
But it is resulting a WP_Error.
Can anyone point me in right direction?
- The topic ‘Redirecting Post to its Term’ is closed to new replies.