模板均来自互联网,在此向原作者表示感谢。如有版权问题,请发邮件(admin@miku.mx)告知

steam和说说模板来自雾时之森

添加追番页面

添加模板

首先下载页面模板

解压之后,把bilibili目录和page-bilibili.php放到主题根目录下。

接着打开page-bilibili.php,搜索我的追番,定位到下图位置,填入UID和cookie即可,如果因为账号安全问题不填写cookie,则无法定位实时观看进度。

获取UID

登录Bilibili账号后进入个人空间,网址后面的账号即为UID

获取cookie

还是先进入个人空间,使用Chrome、Firefox等浏览器,按F12键打开审查元素,切换到Network(网络)选项卡,然后刷新,找到与UID相同的文件并打开(大概率是第一个)

找到cookie一栏,将其完全复制,然后回到page-bilibili.php,将其填入上文提到的位置即可。

添加页面

在wordpress后台新建页面,将页面模板改为bilibili追番模板

添加说说页面

在主题根目录的functions.php添加下列代码

//说说页面
function shuoshuo_custom_init()
{
    $labels = array(
        'name' => '说说',
        'singular_name' => '说说',
        'add_new' => '发表说说',
        'add_new_item' => '发表说说',
        'edit_item' => '编辑说说',
        'new_item' => '新说说',
        'view_item' => '查看说说',
        'search_items' => '搜索说说',
        'not_found' => '暂无说说',
        'not_found_in_trash' => '没有已遗弃的说说',
        'parent_item_colon' => '',
        'menu_name' => '说说'
    );
    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'query_var' => true,
        'rewrite' => true,
        'capability_type' => 'post',
        'has_archive' => true,
        'hierarchical' => false,
        'menu_position' => null,
        'supports' => array(
            'title',
            'editor',
            'author',
            'comments'
 
        )
    );
    register_post_type('shuoshuo', $args);
}
add_action('init', 'shuoshuo_custom_init');

接着在主题根目录新建page-shuo.php写入下列代码,或点此下载

<?php
 
/**
 * Template Name: 说说/微语
 */
 
get_header();
?>
 
    <link href="https://cdn.jsdelivr.net/gh/Fog-Forest/cdn@2.0.5/Sakura/css/shuoshuo.min.css" rel="stylesheet"><!--我直接引入的CSS-->
    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">
            <div class="cbp_shuoshuo">
                <?php
                    query_posts("post_type=shuoshuo & post_status=publish & posts_per_page=-1");
                    if (have_posts()) : ?>
                        <ul class="cbp_tmtimeline">
                            <?php
                                while (have_posts()) : the_post(); ?>
                                    <li>
                                        <span class="shuoshuo_author_img"><img src="<?php echo get_avatar_url(get_the_author_meta('ID')); ?>" class="avatar avatar-48" width="48" height="48"></span>
                                        <a class="cbp_tmlabel" href="javascript:void(0)">
                                        <p></p>
                                        <p><?php the_content(); ?></p>
                                        <p></p>
                                        <p class="shuoshuo_time"><i class="fa fa-clock-o"></i> <?php the_time('Y年n月j日G:i'); ?></p>
                                        </a>
                                    </li>
                                <?php endwhile; wp_reset_query();//重置查询?>
                        </ul>
                    <?php
                    else : ?>
                        <h3 style="text-align: center;">你还没有发表说说噢!</h3>
                        <p style="text-align: center;">赶快去发表你的第一条说说心情吧!</p>
                    <?php
                    endif; ?>
            </div>
        </main><!-- #main -->
    </div><!-- #primary -->
    <script type="text/javascript">
    $(function () {
        var oldClass = "";
        var Obj = "";
        $(".cbp_tmtimeline li").hover(function () {
            Obj = $(this).children(".shuoshuo_author_img");
            Obj = Obj.children("img");
            oldClass = Obj.attr("class");
            var newClass = oldClass + " zhuan";
            Obj.attr("class", newClass);
        }, function () {
            Obj.attr("class", oldClass);
        })
    })</script>
<?php
get_footer();
 

之后添加页面即可

添加追番页面

首先下载模板文件,之后将page-steam.phpjson目录复制到主题的根目录

打开page-steam.php,在下图位置填入SteamID和SteamAPI,在https://steamsignature.com可以获取SteamID

境内服务器请使用下面提供的API或者自建API(将 json 目录中的 SteamAPI.php ,放到任意一台PHP环境的境外虚拟主机或者服务器上)

境外服务器直接把SteamAPI改为$steamAPI = "http://你的网址/json/SteamAPI.php

之后添加页面即可

API示例

https://api网址/SteamAPI.php?id=你的steam id&type=所有游戏填all,最近游玩填recent

API地址

德国(Cloudflare云减速):https://api.miao33.top/SteamAPI.php
香港(据说不稳定):https://api.loli233.ml/SteamAPI.php