doushenmao9036 2018-03-16 15:22
浏览 358
已采纳

更改wordpress主题文件夹名称而不影响网站

I am trying to rename my theme folder in the wp-content/themes folder, but it keeps breaking the site and meaning that I have to re-upload the logo, change all the colors again and etc. It's a bit long and frustrating.

Is there any way I can rename the folder ( change anything in the database and etc ) which stops it from resetting settings?

  • 写回答

1条回答 默认 最新

  • duanchao1002 2018-03-16 16:05
    关注

    Yes, you can change the directory name of your active theme/child theme. The steps you need to do for Parent Theme:

    1. Change theme folder name.
    2. Go to phpMyAdmin, find your wordpress installation database, find the table {your-db-prefix}_options(by default it's wp_options) and find the template from column option_name. Change it's option_value to your theme directory new name. That row will look something like:

      option_id     |      option_name     |    option_value
      ---------------------------------------------------------
      {some_id}     |      template        |    twentyseventeen
      

    If you're going to change the folder name of Child Theme, then instead of template you should find the record stylesheet and make same steps as for Parent theme.

    This will prevent deleting Theme options from database.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复