/ 6评 / 0


首先,复制page.php文件并剪贴重命名为link-page.php,打开link-page.php找到<?php the_content(); ?>替换为如下代码

<div class="links">
 $bookmarks = get_bookmarks('title_li=&orderby=rand'); //全部链接随机输出
 if ( !empty($bookmarks) ){
 foreach ($bookmarks as $bookmark) {
 $friendimg = $bookmark->link_image;
 echo '<a class="link" href="' . $bookmark->link_url . '" target="_blank" style="margin: 0;">
<img src="'. $bookmark->link_image. '" style="cursor: pointer; display: block; margin: 0 auto;">
<div class="sitename">'. $bookmark->link_name .'</div>
<div class="siteinfo">' . $bookmark->link_description . '</div></a>'

如果你想要在友情链接页面显示页面文章内容的话,在</div>后加入<?php the_content(); ?>即可,然后你只需要在后台的链接中添加链接即可


add_filter( 'pre_option_link_manager_enabled', '__return_true' );



.link{outline: none; color: #444;float: left; width: 50%; text-align: center; border-radius: 5px; transition: all .3s ease-in-out;margin-top: 10px;cursor: pointer;}
.link:hover{background-color: #eee}
.link img{width: 70px; height: 70px; border-radius: 70px; margin: 5px 10px !important; transition: all .3s ease-in-out; float: left;}
.link .sitename{font-weight: bold; font-size: 20px; margin-top: 10px;cursor: pointer;}
.link .siteinfo{color: #777; margin-top: 10px; overflow: hidden; text-overflow: ellipsis;}
.links a{text-decoration: none;}



  1. Turkije Visums说道:

    Wow, fantastic weblog layout! How lengthy have you been blogging for?
    you made running a blog glance easy. The full glance of your website is great, as well as the content!

    • Mr.Bean说道:

      @Turkije Visums Yes, my friend, I like simple things. I have been blogging for more than a year. This blog uses Adams theme of WordPress. I really feel like it and your comments. This makes me continue to write. I hope you can see and comment on it regularly.(My English is not good,So the above content is translated using Baidu translation, including this one.)

  2. Turkije Visums说道:

    I got this web site from my buddy who informed me about this
    web site and at the moment this time I am browsing this site and reading very informative posts at this time.

  3. lubin说道:

    Hey there! This post couldn’t be written any better!

    Reading this post reminds me of my good old room mate!
    He always kept talking about this. I will forward this
    write-up to him. Fairly certain he will have a good read.
    Thanks for sharing!


电子邮件地址不会被公开。 必填项已用*标注