0
votes

I am creating a Wordpress theme. I have index.php in my theme's root folder. I have my style.css in a separate folder /css. I've got the beginnings of the design done and everything is working fine.

I now want to add some options with Customizer. I've begun to add some in customizer.php. I then go to check what they look like in wp-admin, click "customize" on my theme and get...

"The active theme is broken. Reverting to the default theme."

The theme was working fine up until that point. I've deleted and re-installed it a couple of times now. All is well until I click "customize".

The error message instructs me to check index.php and style.css, both of which are present. Could it be because style.css is not in the root but in /css? If so, how do I get Customizer to recognise this? My stylesheet has been enqueued correctly in functions.php. As I say above, the theme works fine until I get involved with Customizer.

When I click theme details, wp seems to think the theme is a child of itself too. It isn't a child of anything. I am using underscores starter theme and adapting.

What is going on with Customizer and how do I fix it?

2

2 Answers

1
votes

The style.css is a stylesheet (CSS) file required for every WordPress theme. It controls the presentation (visual design and layout) of the website pages. In order for WordPress to recognize the set of theme template files as a valid theme, the style.css file needs to be located in the root directory of your theme, not a sub-directory.

-1
votes

There must be connection lost when you update resulting to broken themes or missing files.

You need to reinstall a theme :

There are two ways to install WordPress themes.

Method 1.) Direct Upload inside WP Admin Console Method 2.) Using an FTP Client

Method 1 is just a matter of uploading the theme from your WordPress admin console.

Once logged in, navigate to Appearance → Themes and click the "Install Themes" tab. Click the "Upload" link and browse to the location where you extracted the package and upload themename.zip.

Method 2 is pretty straightforward.

Using an FTP client is recommended. If the term FTP scares you, don't worry. It's no different than moving files and folders. Filezilla is a free and trusted FTP client.

Extract themename.zip to your local machine

Login via FTP to your web server and navigate to the /wp-content/themes/ folder

Upload the entire themename folder and its contents. Example: /wp-content/themes/yourtheme/

Open your browser, log in to your WP admin section and (in the left column under Appearance) click the Themes link .Click Activate under the theme you just uploaded.