Why does Wordpress Customizer think my theme is broken? - wordpress

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?

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.

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.

Related

Newly Uploaded WordPress Theme Not Showing Up In Web Sever

I'm new to WordPress. I just successfully installed it on my site.
Now I'm trying to toy with creating my own custom theme. I created one with a custom index.php and a style.css. I zipped the folder, and uploaded it successfully from my WordPress admin by going to Themes > Appearance > Add New > Upload Theme, then browsing the zipped file. I activate the newly uploaded theme, and run my site's url, and lo and behold, the new theme gets loaded up in the browser. So far so good. But then when I look into my wp-content/themes folder in my web server through my ftp client, the newly uploaded theme isn't there. The default themes(twentyfifteen, twentysixteen and twentyseventeed) are all there but not my new theme. What could possibly be happening? Isn't that where the new theme should be?
Is there some crucial step in the installation of WordPress that I may have missed?
On the flip side, if I directly FTP to my new folder into the wp-content/themes folder in my web server, it doesn't show up in my Themes > Appearance page.
What gives? Please any hints/clues will be greatly appreciated.
To reveal weher is your theme
open your site
view page source in your browser (ctrl+u)
press ctrl+f to find this "wp-content/themes/" in the source
next word to "wp-content/themes/" is your loaded theme
There can be multiple WordPress installations on a single web server. Are you sure you are FTP'ing in to the correct web directory? Also, make sure you log in with the master credentials.

Upload theme button don't work in wordpress

I have installed Wordpress in my Godaddy hosting.Its working quite well except i cant upload a new theme. when i click Appearance > Themes and then add new nothing shows up. The only thing that shows up are the buttons featured , most popular etc but when i click them nothing happens. When i press the upload theme button nothing happens either. How do i fix this?
I have tried it switching the default theme, deactivating all plugin but nothing resolver the problem. Godaddy support says that i will get a conformatin mail after the installation process completed within 24hours. Its almost 24hours but i haven't got any conformation mail. What can i do?? Do i really need to wait for the conformation. i can visit my blog but cant upload any theme, whats going wrong??
You can add your theme directly in your Wordpress installation. For this go to public-html/wp-content/themes/ and drop your theme folder here. Remember that your theme files must not be in subfolders of the folder e.g. /themes/your-theme/theme-files-and-folders/
Had the same issue today and solved it using these steps:
Download the Theme .zip file to your machine.
In cPanel File Manager, navigate to your Themes folder. Depending on your hosting, path to Themes folder can differ a bit but essentially you are looking for public_html inside which you’ll find /wp-content/themes/.
Once you’re inside the Themes folder in cPanel File Manager, click on Upload and upload that .zip file you saved in Step 1.
Once the .zip file is uploaded, right click on the name of that file in cPanel and select Extract from the context menu.
Now you can refresh the WordPress themes page and you should be able to Activate it.
The issue was theme related. I just renamed my current theme and then the default theme was automatically activated. Then i was able to upload my zerif lite theme and its now working fine.
I have been through this issue and i have solved it!
it happens mainly when yu transfer wordpress database from another location!
Solution:
UNinstall and deactivate all themes! delete and re install! if you cant delete the theme due to modifications, decativate the theme switch to another new theme by installing from wordpress and then reverting back to old theme!
if the problem persists: Reset server!

wordpress - how to access and edit index.php file

Is there a way to edit the index.php file in wordpress?
Around the web i found a lot of post saying to go to appearance -> editor,
but I can't find this menu... maybe this feature was removed...
So how can I do it?
There are two ways you can edit your PHP files.
Method 1: Edit the file in your Installation Directory on the Web Server
(this is what Anoop Asok is talking about)
Go to WordPress Installation directory. Follow the path wp-content >
themes. Open your theme folder. In that you can see index.php file.
Edit it and save.
Method 2: Edit the file from the WP Dashboard
(This is easier and is what you were trying to do but that file isn't always made available by your theme)
Download, install, and activate the Synchi plugin (this is an awesome IDE and one of its nice features is that it will allow you advanced theme editing)
Go to Appearance > Editor . Now you will see the -themes- window on the right and you will have full access to all your theme files.
Double-click your theme and drill down until you find your file you want to edit
NOTE! You should avoid editing your theme files because they might be over-written next time you update your theme. Make a child theme and put a copy of index.php in there and work off that one instead.
Please do this.
Go to WordPress Installation directory.
Follow the path wp-content > themes.
Open your theme folder.
In that you can see index.php file.
Edit it and save.

Blank page on localhost/wordpress/wp-content/themes/mysitename

I'm creating my own WordPress theme and I've set it up locally with MAMP. It all works fine and the theme appears when I enter localhost/wordpress in my browser. But when I enter localhost/wordpress/wp-content/themes/mysitename it is just a white blank page.
In the WordPress dashboard under themes the image next to my theme where it lets you activate it is also blank.
How can I get it to appear? Thanks in advance!
WordPress uses a frontend controller system where all site traffic passes through the index.php file in the root of the site.
Directing your browser to "localhost/wordpress/wp-content/themes/mysitename" bypasses the main controller, which means you are bypassing WordPress altogether and attempting to directly access files on the server. That directory would need to have an index.html or index.php file within it to produce some kind of output.
In order to have an image beside your custom theme in the admin, you need to create a screenshot of your theme and name it "screenshot" (can be a jpg or png) and place it in the root folder of your theme. Look inside other WP theme folders for an example of what I am talking about.

Find the source files of Wordpress

i mean i want to see the source file of the main page.
when i click right click and choice the option view source, so i want to find
the "body" of the file,and edit it physical, which folder can i find it ?
thanks friends.
WordPress's HTML is generated by PHP in conjunction with CSS, so look in your active theme folder in wp-content/themes/yourtheme. You'll find all the parts of a WordPress theme: Using Themes « WordPress Codex.
WordPress runs on the server -- the "source" you're viewing from your browser is client-side, and is essentially the output of the WordPress PHP code that generates the pages (and some CSS transforms). In order to see the PHP source, you'll have to download it from WordPress's website yourself or look at your WP installation directory on your server.

Resources