WordPress使用总结(持续更新)
本文最后更新于0 天前,其中的信息可能已经过时,如有错误请发送邮件到1729915388@qq.com

使用的插件

  1. 20221120更新 ---- 显示网站统计信息使用插件WP Statistics
  2. 20221120更新 ---- 显示头像信息使用插件WP-China-Yes
  3. 20221212更新 ---- 解决无权限上传此类文件使用插件WP Extra File Types
  4. 20230610更新 ---- 使用markdown编辑文本直接放到wordpressWP Githuber MD
  5. 20230610更新 ---- 使用markdown编辑的公式直接放到wordpress显示WP QuickLaTeX

文章分享

  1. 20221203更新 ---- 在 wordpress 实现评论显示 IP 归属 (这里使用的是 argon 主题)
  2. 20221213更新 ---- 更改wordpress的鼠标指针
  3. 20221213更新 ---- 在写文章时让文字跳转到对应标题

使用的插件

显示网站统计信息WP Statistics

  • 使用WP Statistics插件
    1. 在插件中安装WP Statistics插件,并启用插件
    2. 点击外观->自定义->小工具->站点概览额外内容
    3. 点击+号,选择统计,就可以选择自己想要展示的东西了

显示头像信息WP-China-Yes

  • 可从WordPress后台【插件】-【安装插件】搜索WP-China-Yes安装(这里我没有搜到我使用的另一种方法)

解决无权限上传此类文件WP Extra File Types

  • 可从WordPress后台【插件】-【安装插件】搜索WP Extra File Types安装
  • WP Extra File Types的使用
    1. 在 设置-->Extra File Types,看到多个文件扩展名,按 ctrl+F 搜索,并输入你要添加的扩展名,勾选后,保存。
    2. 如果预设的扩展名里没有要添加的文件类型,还可以在最下面自定义添加。
      • 三栏分别是描述、文件扩展名、文件类型,保存更改即可。
      • 添加示例:| cursor file | .cur | cursor |
    3. 如果保存后还是不能上传指定的扩展名,就退出 WordPress 登录状态,清理网站缓存,再重新登录,一般过一会儿就能正常上传了。



评论显示IP归属(以argon主题为例)

下载压缩包,上传到主题根目录

  1. 我的主题根目录是/wp-content/themes/argon-theme-master
  2. 直接将解压好的文件夹放在主题根目录。

编辑functions.php

  • 在php内添加一行代码:
include("useragent/ip2c-text.php");
  1. agron主题这里还是修改functions.php,评论模版方法为argon_comment_format(使用ctrl+F搜索)
  2. <div class="comment-author"><span class="shuoshuo-comment-item-title">(这里不知道是否需要添加)下添加如下代码
<?php 
    echo " ";echo "<span id='ua-info-text' class='comment_ua_info' style='font-size:14px;font-weight:normal;color:#aaa;'>"; 
    echo convertip(get_comment_author_ip()); 
    echo "</span>"; 
?>
  • 对于使用其他主题的,需要编辑xxx-comment.php 模板 (找评论模版中的方法)

添加的代码同上

编辑footer.php

  • 添加以下代码
<!-- comment ua-info -->
<script>
jQuery('.comment-body').hover(    
   function(){
       jQuery(this).find('span.comment_ua_info').show();
  },
   function(){
       jQuery(this).find('span.comment_ua_info').hide();
  });
jQuery('.comment-body').click(    
   function(){
       jQuery(this).find('span.comment_ua_info').show();
  });
</script>

自动更新纯真IP离线库

  • 新建一个php文件,网络访问它,即可生成一个dat文件。(这个文件在压缩包中下载的有,不需要再次创建了。)
<?php
// PHP 纯真 IP 地址数据库自动更新功能
copywrite = file_get_contents("http://update.cz88.net/ip/copywrite.rar");
qqwry = file_get_contents("http://update.cz88.net/ip/qqwry.rar");
key = unpack("V6",
copywrite)[6];
for(
i=0;
i<0x200;
i++){
key *= 0x805;
key ++;
key =
key & 0xFF;
qqwry[
i] = chr( ord(
qqwry[
i]) ^
key );
}
qqwry = gzuncompress(
qqwry);
fp = fopen("qqwry.dat", "wb");if(
fp){
fwrite(
fp,
qqwry);
fclose($fp);
}
?>
  • 使用到宝塔面板的自动访问URL设置好时间,自动定期访问这个1.php文件就可以自动下载最新的纯真IP离线库了。(在计划任务中设置)

结果展示

自己去评论区看-哈哈哈哈




更改wordpress的鼠标指针

上传鼠标图标文件

  • 需要上传两个鼠标图标文件(两个.cur文件,如何上传.cur文件上面有说),一个是普通指针,另一个是链接指针(可自行百度自己想要的图标样式)
  • 然后进入wordpress的仪表盘 --> 外观 --> 自定义 --> 额外CSS 把下面代码复制上去
/** 鼠标样式 开始**/ 
/** 普通指针样式**/ 
body {
cursor: url(https://www.xyqiang.top/wp-content/uploads/2022/12/Arrow.cur), default;
}
 
/** 链接指针样式**/ 
a:hover{cursor:url(https://www.xyqiang.top/wp-content/uploads/2022/12/Hand.cur), pointer;}
 
/** 鼠标样式 结束**/
  • 把链接改成自己图标的链接即可。



写文章时文字跳转到对应标题

  1. 把需要修改的文字作为HTML编辑加上<a href="#xxx">其中#为id选择器
  2. 把需要跳转到地方也设置为当作HTML编辑,在最外层的标签里加上id="xxx"

这样就设置成功了

评论

  1. 博主
    Windows Chrome

    Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

    Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

    Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13

    Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13
    System Error
    6月前
    2022-12-03 18:23:34

    评论也可以看到有ip归属

    • 博主
      root
      Windows Chrome

      Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

      Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

      Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13

      Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13
      System Error
      6月前
      2022-12-04 14:19:47

      • 博主
        root
        Windows Chrome

        Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

        Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 11

        Warning: unpack(): Type L: not enough input, need 4, have 0 in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13

        Warning: implode(): Invalid arguments passed in /www/wwwroot/xyqiang.top/wp-content/themes/argon-theme-master/useragent/ip2c-text.php on line 13
        System Error
        5月前
        2023-1-06 9:05:22

        ヾ(≧∇≦*)ゝ

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇