大家都知道,页面里太多外链是不太好的,但是链接总不能不上吧,那么内链转外链就是最佳选择!

以前也曾介绍过一些,这次呢,代码版,还挺好看的!

废话就不说了,直接把下面的代码保存到主题就好了!当然,你也可以修改一下,保存到根目录等,一些自己选择咯!(这不是废话吗?)

<?php
/*
Template Name: 链接跳转
*/
	$guodu = get_post_meta($post->ID,"guodu", $single=true);
	$false='false';
	if ($guodu==$false){
	$url = $_GET['url'];
	Header("Location:$url");
	}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php $time=get_post_meta($post->ID,"time", $single=true); ?>
<meta http-equiv="refresh" content="2;url='<?php echo $_GET['url'];; ?>';">
<title> 页面跳转 ing - <?php bloginfo('name'); ?></title>
<style>
body{background:#000}.loading{-webkit-animation:fadein 2s;-moz-animation:fadein 2s;-o-animation:fadein 2s;animation:fadein 2s}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-o-keyframes fadein{from{opacity:0}to{opacity:[email protected] fadein{from{opacity:0}to{opacity:1}}.spinner-wrapper{position:absolute;top:0;left:0;z-index:300;height:100%;min-width:100%;min-height:100%;background:rgba(255,255,255,0.93)}.spinner-text{position:absolute;top:41.5%;left:47%;margin:16px 0 0 35px;color:#BBB;letter-spacing:1px;font-weight:700;font-size:9px;font-family:Arial}.spinner{position:absolute;top:40%;left:45%;display:block;margin:0;width:1px;height:1px;border:25px solid rgba(100,100,100,0.2);-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;border-left-color:transparent;border-right-color:transparent;-webkit-animation:spin 1.5s infinite;-moz-animation:spin 1.5s infinite;animation:spin 1.5s infinite}@-webkit-keyframes spin{0%,100%{-webkit-transform:rotate(0deg) scale(1)}50%{-webkit-transform:rotate(720deg) scale(0.6)}}@-moz-keyframes spin{0%,100%{-moz-transform:rotate(0deg) scale(1)}50%{-moz-transform:rotate(720deg) scale(0.6)}}@-o-keyframes spin{0%,100%{-o-transform:rotate(0deg) scale(1)}50%{-o-transform:rotate(720deg) scale(0.6)[email protected] spin{0%,100%{transform:rotate(0deg) scale(1)}50%{transform:rotate(720deg) scale(0.6)}}
</style>
</head>
<body>
<div >
  <div >
    <span >LOADING...</span>
    <span ></span>
  </div>
</div>
</body>
</html>

保存好了,添加一个页面就好了!使用方法就是地址后面加 get 数据 ?url=