配置过程
1、新建页面模板
比如命名为links-check.php

<?php 

/**
 Template Name: 链接检测模版
 */

get_header(); 
// 网址访问判断
function httpcode($url){
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_HEADER, 1);
        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        curl_setopt($ch,CURLOPT_URL,$url);
        curl_exec($ch);
        return $httpcode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
        curl_close($ch);
}
//链接访问状态判断函数
function link_status($link)
{
    //ini_set('max_execution_time',15);
    $status=httpcode($link);
    if($status == 200 ) 
        return "<p><i class=\"fa fa-check-circle\" aria-hidden=\"true\"></i> 访问正常</p>";
    else
        return "<font color=\"#CCA700\"><i class=\"fa fa-exclamation-circle\" aria-hidden=\"true\"></i>  无法访问</font>";
}

//列出指定链接
function the_link_items($id = null)
{
    $bookmarks = get_bookmarks('orderby=date&category=' . $id);
    $output = '';
    if (!empty($bookmarks)) {
        $output .= '<ul class="link-items fontSmooth">';
        foreach ($bookmarks as $bookmark) {
            if (empty($bookmark->link_description)) {
                $bookmark->link_description = __('This guy is so lazy ╮(╯▽╰)╭', 'sakurairo');
            }

            if (empty($bookmark->link_image)) {
                $bookmark->link_image = 'https://view.moezx.cc/images/2017/12/30/Transparent_Akkarin.th.jpg';
            }
            $output .= '<li class="link-item"><a class="link-item-inner effect-apollo" href="' . $bookmark->link_url . '" title="' . $bookmark->link_description . '" target="_blank" rel="friend"><img src="' . $bookmark->link_image . '" src="/load/inload.svg"><span class="sitename">' . $bookmark->link_name . '</span><span>' . link_status($bookmark->link_url). '</span><div class="linkdes">' . $bookmark->link_description . '</div></a></li>';
        }
        $output .= '</ul>';
    }
    return $output;
}

//列出所有链接
function link_items()
{
    $linkcats = get_terms('link_category');
    if (!empty($linkcats)) {
        foreach ($linkcats as $linkcat) {
            $result .= '<h3 class="link-title"><span class="link-fix">' . $linkcat->name . '</span></h3>';
            if ($linkcat->description) {
                $result .= '<div class="link-description">' . $linkcat->description . '</div>';
            }

            $result .= the_link_items($linkcat->term_id);
        }
    } else {
        $result = the_link_items();
    }
    return $result;
}

?>
    <?php while(have_posts()) : the_post(); ?>
    <?php if( !get_post_thumbnail_id(get_the_ID())) { ?>
    <span class="linkss-title"><?php the_title();?></span>
    <?php } ?>
        <article <?php post_class("post-item"); ?>>
            <?php the_content(); ?>
            <div class="links">
                <?php echo link_items();//列出所有友情链接,若列出分组id为49的则改为the_link_items('49') ?>
            </div>
        </article>
    <?php endwhile; ?>
<?php
get_footer();

2、引入css
add-style.css(比较长,就不贴出来了)
源码下载
蓝奏云

Q.E.D.


繁华看淡即是浮云;烦恼无数,想开就是晴天