wordpress添加本地上传头像功能

流年 1 8911字数 586阅读1分57秒

wordpress添加本地上传头像功能

[inlosc_ls_infobox]下载文章下面的附件[/inlosc_ls_infobox]

第一步:将附件中的 simple-local-avatars.js 复制到当前主题的 js 目录。

第二步,打开附件 simple-local-avatars.php 文件,将大约第178行的:

wp_enqueue_script( 'simple-local-avatars', plugins_url( '', __FILE__ ) . '/simple-local-avatars' . $script_name_append . '.js', array('jquery'), false, true );

将中间的js路径改为你的 simple-local-avatars.js的存放路径!

第三步,打开当前主题的 functions.php 模板文件,在最后添加:

require get_template_directory() . '/inc/simple-local-avatars.php';

主题把代码的路径改为simple-local-avatars.php的存放路径!

最后大功告成!

[inlosc_lg_title]附件下载:[/inlosc_lg_title]
[inlosc_dl title="附件下载" href="https://pan.baidu.com/s/1cEpbQ2"]点击下载[/inlosc_dl]

流年
  • 本文由 流年 发表于 2017年9月3日12:58:46
  • 除非特殊声明,本站文章均为原创,需要转载,请留言说明!
    • 何室庆博客
      何室庆博客 1

      不是吧,我也去试试

    匿名

    发表评论

    匿名网友
    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
    确定

    拖动滑块以完成验证