当前位置:首页 > WordPress教程 > 正文

代码添加好看链接跳转功能 内链转外链

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

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

go

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

<?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:1}}@keyframes 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)}}@keyframes spin{0%,100%{transform:rotate(0deg) scale(1)}50%{transform:rotate(720deg) scale(0.6)}}
</style>
</head>
<body>
<div class="loading">
  <div class="spinner-wrapper">
    <span class="spinner-text">LOADING...</span>
    <span class="spinner"></span>
  </div>
</div>
</body>
</html>

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

标签:
上一篇: 下一篇:

24 条评论

评论加载中...
  1. 403815 592158My wife style of bogus body art were being quite unsafe. Mother worked with gun very first, following which they your lover snuck totally free upon an tattoo ink ink. I was positive the fact just about every ought to not be epidermal, due to the tattoo ink could be attracted from the entire body. make an own temporary tattoo 479344

    2018年8月15日 21:34 评论
  2. 6265 316134Register a domain, search for available domains, renew and transfer domains, and decide on from a wide variety of domain extensions. 21061

    2018年8月14日 15:59 评论
  3. 12楼
    来自天朝的朋友 谷歌浏览器 Windows 7
    呼死你  

    无敌呼死你

    2018年2月9日 16:48 评论
  4. 11楼
    未知系统 火狐浏览器 Windows 7
    中国历史  

    小幻,第一张图片预览不了?

    2015年6月15日 09:16 评论

发表评论

不理你。不要啊!吃饭。吃惊。吃西瓜。飞吻!恭喜!Hi纠结!膜拜!OK抛媚眼。泡泡糖。抛钱。忍!生闷气!调皮。偷看。委屈。献花。疑问?抓狂!

小提示:Ctrl+Enter快速提交助您一臂之力~
加载中……