0

I am creating theme for WordPress which I hope to maintain. The current method of updating a non-WordPress hosted theme is to either replace the old theme with the new theme through FTP or switch to say WP2016 then delete the old theme and install the new one. Neither of these are really user friendly methods.

Would there be any problems (e.g. using numbers in theme name) if I start with say MyTheme_1_0 then when I have updated it call it MyTheme_1_1. This way the theme can be installed and switched to directly from the Theme page, without the need of a FTP or switching to a default theme, and the user can roll back to the old theme if need be.

  • Did you find an answer to this question? – jdm2112 Jul 14 '16 at 18:01
0

The name change by itself will not cause any problems, as long as the file header info is unique between them. https://codex.wordpress.org/File_Header

Why not use the version meta on the theme and retain the same name and directory structure for the theme?

You could also place the files in a proper version control system. Host the theme somewhere like Github or Beanstalk and use the tools that exist to manage version control.

  • "Why not use the version meta on the theme and retain the same name and directory structure for the theme?" Do you mean just change the version number in the file, header? But that won't show up in the Theme section in WP unless you select a theme first. – Naz May 7 '16 at 14:36
0

Read this through: Wordpress Theme Hierarchy

Creating custom wordpress themes are fun. You shouldnt be needing to overwrite or rename themes, you could just easily switch between them on your admin panel if the theme files set correctly like (Style.css)

/*
Theme Name: Your Theme Name 
Theme URI: URL
Author: Most Likely  You
Author URI: your@email.com   
Description: Responsive frameworks 
License URI: http://www.opensource.org/licenses/mit-license.php.
License: http://www.opensource.org/licenses/mit-license.php.
Version: 2.0
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

Mandatory files for your theme are:

  1. index.php
  2. header.php
  3. footer.php
  4. loop.php
  5. style.css

I hope this helps you to get on the right track...

  • header, footer and loop IS NOT mandatory. A theme only needs style.css and index.php. The header and footer and loop can be hardcoded into index.php – Pieter Goosen May 8 '16 at 11:35
  • for someone just getting into custom themes, i think is more suitable this way, than hardcoding from the beginning... peace. – nesh May 8 '16 at 12:19
0

You can name your theme anything you want. So you can also pretend that an update is a different theme by putting it in a different directory. Hey, you can even upload the exact same theme several times in different directories and WP will think they are different themes.

You will, however, run into troubles with the option table in the database. If two themes use the same option names, they will overwrite eachother in the database. So if you have several versions of the theme in the same WP install, don't think you can have different options or theme customizations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.