网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

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

GG网络技术分享 2025-03-18 16:12 0


问题描述:

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?

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~

功能建议

我正在尝试重命名 wp-content / themes </ code>文件夹中的主题文件夹, 但它不断破坏网站,意味着我必须重新上传徽标,再次更改所有颜色等等。

这有点长而且令人沮丧。 </ p>

我有没有办法重命名文件夹(更改数据库中的任何内容等)以阻止它重置设置?</ p>

</ div>

网友观点:

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.

标签:

提交需求或反馈

Demand feedback