diff --git a/tag.php b/tag.php index cc74cbc028..30b56973f7 100644 --- a/tag.php +++ b/tag.php @@ -21,10 +21,10 @@ $tag = get_queried_object(); $redirect_id = get_term_meta($tag->term_id, 'redirect_page', true); -$redirect_page = get_post($redirect_id); -if ($redirect_page) { +if ($redirect_id) { global $wp_query; + $redirect_page = get_post($redirect_id); $wp_query->queried_object = $redirect_page; $wp_query->queried_object_id = $redirect_page->ID;