WordPress自定义友情链接页面模板

释放双眼,带上耳机,听听看~!

站内演示效果

https://www.qwbk.net/youqingqiang

代码

<?php
/**
* Template Name: 友情墙
*/
get_header(); ?>

<main class="container">
<div class="page-friends page-common row">
<?php if (have_posts()): ?>
<?php while (have_posts()) : the_post(); ?>
<h1 class="page-title"><?php the_title(); ?></h1>
<article class="page-content">
<?php the_content(); ?>
</article>
<?php endwhile; ?>
<?php endif; ?>
<style>
.clearfix {zoom:1;}
.clearfix:after {content:”.”;display:block;visibility:hidden;height:0;clear:both;}
.readers-list {list-style:none;}
.readers-list *{margin:0;padding:0;}
.readers-list li{position:relative;padding:10px;float:left;margin-top:20px!important;}
.readers-list li > a {
border: 1px solid #eee;
display: block;
height: 85px;
text-align: center;
transition:all .5s;
background: #f9f9f9;
}
.readers-list li>a:hover{border-color:#e5e5e5;}
.readers-list a:hover em{top:45px;font-size:1.1em;}
.readers-list a:hover span{opacity:1;left:50%;}
.readers-list img{position:absolute;top:-30px;left:calc(50% - 30px);width:60px;height:60px;border-radius:50%;0px 0px 10px 5px #008EC2;box-shadow:0 0 6px 3px #0081B1;transition:all 1s;background:#fff;}
.readers-list a:hover img {
-webkit-transform:scale(.7);
-moz-transform:scale(.7);
-o-transform:scale(.7);
-ms-transform:scale(.7);
transform:scale(.7);
border-radius: 0;
}
.readers-list em{
position: absolute;
top: 60px;
-webkit-transform: translateX(-50%);
left: 50%;
font-style: normal;
font-size: 1.2em;
color: #818181;
transition: all .3s;
font-family: Helvetica,Arial,"PingFang SC","Microsoft YaHei","WenQuanYi Micro Hei","tohoma,sans-serif"
}
.readers-list span {
position: absolute;
left: 20%;
bottom: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
-webkit-transform: translateX(-50%);
width: calc(100% - 30px);
opacity: 0;
transition:all .3s;
color: #818181;
font-family: Helvetica,Arial,"PingFang SC","Microsoft YaHei","WenQuanYi Micro Hei","tohoma,sans-serif"
}
@media(min-width:768px){
.readers-list li{width:25%;}
}
@media(max-width:767px){
.readers-list li{width:100%;}
}
</style>
<div>
<?php
global $wpdb;
$qlink="select link_url,link_name,link_image,link_notes,link_description from wp_links where link_visible='Y' order by link_id";
$links = $wpdb->get_results($qlink);
if(empty($links)) {echo '<p>暂无友链数据!</p>';}
foreach ($links as $comment){
$tmp = "<li><a rel=\"nofollow\" title=".$comment->link_url." target=\"_blank\" href=\"/go?url=".$comment->link_url."\"><img src=".$comment->link_image." alt=\"\"><em>".$comment->link_name."</em><span>".$comment->link_notes."</span></a></li>";
$output1 .= $tmp;
}
$output1 = "<ul class=\"readers-list clearfix\">".$output1."</ul>";
echo $output1;
?>
</div>
<?php
if(comments_open()){
comments_template();
}else{
echo "<h5>评论已经关闭</h5>";
}
?>
</div>
</main>
<?php get_footer(); ?>

给TA买糖
共{{data.count}}人
人已赞赏
Wordpress

Wordpress DUX主题v7.1免费下载

2021-11-5 10:53:15

网站源码

在线放烟花网站源码

2021-11-16 13:47:06

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
  • 9 用户总数(个)
  • 1279 文章总数(篇)
  • 19065 浏览总数(Pv)
  • 0 今日发布(篇)
  • 707 稳定运行(天)
立即加入

加入QWBK - ,快速免费获取轻微资源!