admin管理员组

文章数量:1291040

I'm using a customised version of a commercial theme, with a lot of stuff in it.

I've changed style.css to only have:

/*!
Theme Name: A quite unique theme name
Theme URI: /
Version: 1.0.0
Description: Unique description
*/

Wordpress still finds an 'update' for the theme using the original name of the theme from the vendor. Wordpress says the current version is 1.0.0, which matches the style.css header.

Where is it getting the name from in order to look up the update?

Thanks!

I'm using a customised version of a commercial theme, with a lot of stuff in it.

I've changed style.css to only have:

/*!
Theme Name: A quite unique theme name
Theme URI: http://www.mywebsite/
Version: 1.0.0
Description: Unique description
*/

Wordpress still finds an 'update' for the theme using the original name of the theme from the vendor. Wordpress says the current version is 1.0.0, which matches the style.css header.

Where is it getting the name from in order to look up the update?

Thanks!

Share Improve this question asked Jun 3, 2021 at 14:49 mozbozmozboz 2,6281 gold badge12 silver badges23 bronze badges 3
  • 1 Curious as to why you wouldn't create a child theme instead of modifying a commercial theme. The method you have chosen means you won't get any theme updates, including security updates and bug fixes. – vancoder Commented Jun 3, 2021 at 15:06
  • @vancoder Yeah good point. The modifications I've made were not to the usual theme files but to some of the core working in some application logic. I am dumb and lazy, so have not checked if it's easily possible to override a PHP file with application logic in it from a child theme. – mozboz Commented Jun 3, 2021 at 15:16
  • You can declare plugins to be private in 5.8 which should avoid this, maybe the same is true of themes? – Tom J Nowell Commented Jun 3, 2021 at 15:30
Add a comment  | 

2 Answers 2

Reset to default 1

It's the directory name.

If your theme is in wp-content/themes/my-theme, then the theme name is my-theme.

For anyone looking to change the theme name (which as per Jacob's answer is the directory name) and have Wordpress not know what you've done you can manually change settings as described here: https://docs.appthemes/tutorials/how-to-change-wordpress-themes-directly-from-the-database/

For me the 'template' option also needed to be the directory name, it did not work as the string of the name as in the style.css header, which is what this doc says.

Also the commercial theme I was using did do some slightly weird things but they were an easy fix, so I would not recommend doing this without thoroughly testing that a theme/plugin you're using doesn't have some stored hard-coded reference to the directory name somewhere!

本文标签: Where does Wordpress get the theme name from to check for updates