简体   繁体   中英

WordPress not recognizing theme in /themes/ folder

Having a really baffling issue with permissions, WordPress and theme files.

I have a fresh install of WordPress and tried uploading the theme I made for my client. It uploaded fine but it doesn't show up in the Manage Themes menu. I checked everything was uploaded and it was. Checked permissions (even set them to 777 at one point) and they were fine. But the theme doesn't show up.

Here are the different scenarios I've tried:

  • Using the Install Themes menu and uploading a .zip ( failed )
  • Duplicate twentyten folder and contents ( worked )
  • Duplicate twentyten folder and used my theme files ( failed )
  • Duplicate twentyten folder and used my theme files and their style.css ( failed )
  • Uploaded my theme WITHOUT style.css ( gave missing style.css error )
  • Uploaded my theme WITHOUT style.css and put in twentyten/created one from scratch ( both failed )

I'm on my clients MediaTemple hosting and I've never encountered this error. Their support has yet to get back to us.

Does anyone have a similar problem? Solution? It's possible I can give you FTP access if needed.

CSS Head (changed values but format and everything is still the same):

/*
Theme Name: Example Theme
Theme URI: http://example.com/
Description: WordPress theme
Author: Company
Version: 1.0
*/

Edit: Trying to access the folder through my browser results in a 403 error (works fine on twentyten). style.css can be viewed from the browser.

如果您使用的是WordTI的MULTI-SITE安装,则必须首先进入网络管理员,从左侧菜单中选择主题并启用您想要使用的主题,然后才能在网站管理员的“管理主题”页面上显示部分。

On Ubuntu 14.04 you can install the wordpress package simply using sudo apt install wordpress but then you have to set a link to the themes directory.

Eg for your "newTheme":

ln -s /usr/share/wordpress/wp-content/themes/newTheme /var/lib/wordpress/wp-content/themes

Perhaps you are missing a required template file?

At the very minimum, a WordPress Theme consists of two files:

style.css

index.php

http://codex.wordpress.org/Theme_Development

I bet you have some special characters in your templates. This once drove me nuts to find. Check your Template files and/or rename them until the theme shows up. I used a german "ö" in a templates name.

I had a very similar problem. Spent a few hours before I found that somehow when I moved my local site (probably using All-in-one Wp Migration plugin), a .htaccess file was created in the /wp-content folder. I don't remember what was inside this file but I think it didn't matter. After removing this file everything was ok.

正如我在曲折故障排除结束时发现的那样旧的wp-config.php可能导致新安装的主题在/wp-admin/themes.php中未被检测到并且不可见 - 我不确定您是否有完全相同的问题但是它看起来与我的非常相似,您可能希望尝试使用Wordpress新生成的wp-config.php进行配置。

  1. Make a backup of your styles.css
  2. Copy the styles.css file from twentyforteen to your theme folder.
  3. Only change the template name at the top of the file
  4. Re-load the themes page in WordPress admin; once you've seen it working,
  5. Further-modify the new styles.css file as needed.

Is the theme folder name different than everything else? Is the Theme Name in style.css different than everything else?

I am guessing BOM s are the problem. They messed up my validation of a page once, as I tried to remove the BOM. Try using an editor and remove the BOMs. For Notepad++ , the text editor I use, I just set the encoding to UTF-8 without BOM and saved. That solved my problem. Of course, your text editor may be different.

问题可能是你在.zip上传的

Your php setting might disable the scandir . It may cause the wordpress cannot scan the theme folder

Solution: find php.ini. You may run php --ini to get the php.ini file location.

Open php.ini,Search for disable_functions , then you may remove scandir parameter. Save and restart your php services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM