CSS 如何在xampp中安装下载的wordpress主题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12135398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to install downloaded wordpress theme in xampp
提问by user1626562
I am trying to install a theme I downloaded from this website.
I am using XAMPP and I am not sure how to install this dowloaded theme using XAMPP.
I tried installing this theme with the zip folder (in zip format) in Wordpress but I get the error
” The package could not be installed. The theme is missing the style.css stylesheet.
Theme install failed. “
我正在尝试安装从该网站下载的主题。我正在使用 XAMPP,但不确定如何使用 XAMPP 安装这个下载的主题。
我尝试在 Wordpress 中使用 zip 文件夹(以 zip 格式)安装此主题,但出现错误“无法安装包。主题缺少 style.css 样式表。主题安装失败。“
I found a similaron Wordpress website but they mentioned using FTP but I don't know how to use FTP with XAMPP
我在 Wordpress 网站上找到了类似的,但他们提到使用 FTP,但我不知道如何将 FTP 与 XAMPP 一起使用
I want to install the theme and test it out locally before I make it live or buy a domain name.
我想安装主题并在本地进行测试,然后再上线或购买域名。
This is my first time doing this (I am a student) so I don't totally know how things work together, don't know if I am using the description/terms but I hope I described the problem well enough.
这是我第一次这样做(我是学生),所以我不完全知道事情是如何协同工作的,不知道我是否使用了描述/术语,但我希望我能很好地描述问题。
How to go about this? Any help will be appreciated.
如何解决这个问题?任何帮助将不胜感激。
Thanks
谢谢
回答by MeltingDog
OK so its a bit weird that the theme you downloaded is missing the CSS file. When you upload it Wordpress is trying to find that file and failing. For now, let's assume that the creator of the theme put the CSS file in a different location than usual.
好的,所以您下载的主题缺少 CSS 文件有点奇怪。当您上传它时,Wordpress 正在尝试查找该文件并失败。现在,让我们假设主题的创建者将 CSS 文件放在与平常不同的位置。
To install a theme manually via XAMPP do the following:
要通过 XAMPP 手动安装主题,请执行以下操作:
Locate XAMPP's htdocs folder. This is normally Applications>>XAMPP>>HTDOCs on Mac or My Computer>>C:>>XAMPP>>HTDOCs on Windows (I think - someone might need to correct me on that).
If your site is installed in a sud-directory in htdocs, go there. If not skip to next step.
Open the wp-content folder
Open the themes folder
Copy in your downloaded theme and extract it there (if its zipped)
Go to your Wordpress Dashboard and go to the Appearance button on the left and click Themes from the drop down. Find your newly installed theme and hit Activate.
找到 XAMPP 的 htdocs 文件夹。这通常是 Mac 或我的电脑上的应用程序>>XAMPP>>HTDOCs>>C:>>XAMPP>>Windows 上的HTDOCs(我认为 - 有人可能需要纠正我)。
如果您的站点安装在 htdocs 的 sud 目录中,请转到那里。如果没有跳到下一步。
打开 wp-content 文件夹
打开主题文件夹
复制您下载的主题并将其解压缩到那里(如果已压缩)
转到您的 Wordpress 仪表板,然后转到左侧的外观按钮,然后从下拉列表中单击主题。找到您新安装的主题并点击激活。
That should do the trick unless your theme is missing some vital elements
除非您的主题缺少一些重要元素,否则这应该可以解决问题
(PS: what your are doing here - moving (theme) files from one location to another - is essentially the same as FTP. Difference is FTP allows you to transfer files accross the internet from computer to computer: say your computer to a web server hosting your site.)
(PS:您在这里所做的 - 将(主题)文件从一个位置移动到另一个位置 - 本质上与 FTP 相同。不同之处在于 FTP 允许您通过 Internet 在计算机之间传输文件:比如说您的计算机到 Web 服务器托管您的网站。)
回答by arunwebber
Add this lines to your wp-config.php file
将此行添加到您的 wp-config.php 文件中
//** To add the direct installation of the themes **//
define('FS_METHOD', 'direct');
Then go to wp-admin and click on customize your site. Press on change button on the active theme and browse for your favorite theme from wordpress.org and install then enjoy
然后转到 wp-admin 并单击自定义您的站点。按活动主题上的更改按钮并从 wordpress.org 浏览您最喜欢的主题并安装然后享受