<?php
/*******跳转模板*******/
global $wp_rewrite,$wp_query;
if( isset($wp_query->query_vars['mallid']) && $wp_query->query_vars['mallid']!='' )
	$mall_id = $wp_query->query_vars['mallid'];
else
	$mall_id = 0;
if( $mall_id ){
	$buy_link = get_term_meta($mall_id,'_mall_link',true);
	$buy_link = trim($buy_link);
	$buy_link = addhttp(trim($buy_link));
	if($buy_link){
		wp_redirect($buy_link, 301);
	}else{
		wp_redirect(get_bloginfo('url'), 301);
	}
}else{
	wp_redirect(get_bloginfo('url'), 301);
} ?>