2017-05-27 117 views
1

所以即時新的WordPress的,我只是在我的WordPress內容項目中創建了一個自定義主題我的wp-content/themes/mytheme我添加了一個index.php,blog.css和一個style.css文件添加到新主題中,但是當我轉到儀表板中的主題時,新創建的主題不會顯示爲選項。 我還缺少什麼? 感謝wordpress定製主題沒有出現在儀表板

的style.css

/* 
Theme Name: Start WordPress 
Theme URI: http://wordpress.org/themes/startwordpress 
Author: Me 
Author URI: http://wordpress.org/ 
Description: The Start WordPress theme is my first custom theme. 
Version: 1.0 
License: GNU General Public License v2 or later 
License URI: http://www.gnu.org/licenses/gpl-2.0.html 
Tags: bootstrap, black, brown, orange, tan, white, yellow, light, one- 
column, two-columns, right-sidebar, flexible-width, custom-header, 
custom-menu, editor-style, featured-images, microformats, post- 
formats, rtl-language-support, sticky-post, translation-ready 
Text Domain: startwordpress 

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. 
*/ 

回答

0

只是爲了好玩。不要添加blog.css。

只要使用style.css和基本文件,直到看到它。在進行故障排除時 - 只需使用index.php和style.css並保持內容不變。

https://codex.wordpress.org/Theme_Development#Basic_Templates

/* 
Theme Name: Example theme name 
Theme URI: n/a 
Author: you 
Author URI: n/a 
Description: example description... 
Version: 1.0 
License: GNU General Public License v2 or later 
License URI: http://www.gnu.org/licenses/gpl-2.0.html 
Tags: example-tag 
*/ 

當一個主題顯示不出來,往往是在主題管理如下圖所示的錯誤。

0

除了圖片和JavaScript文件,WordPress主題通常由三種主要類型的文件組成。

1.樣式表稱爲style.css,它控制網頁的顯示(視覺設計和佈局)。

2.WordPress模板文件控制站點頁面生成WordPress數據庫信息的方式顯示在站點上。

3.可選功能文件(functions.php)作爲WordPress主題文件的一部分。

例子: -

遵循的wp-content路徑>主題在你的主題文件夾到達。你會看到WordPress的默認主題 - 二十五,二十四,二十十三 - 和index.php。爲您的主題創建一個新目錄;我叫我的startwordpress。

/* 
Theme Name: Start WordPress 
Author: Tania Rascia 
Description: Bootstrap Blog template converted to WordPress 
Version: 0.0.1 
Tags: bootstrap 
*/ 

只要按照這個鏈接https://www.taniarascia.com/developing-a-wordpress-theme-from-scratch/

+0

這是繼例如IM,所以我不會知道到什麼地方,因爲這裏的主題沒有出現,我跟本教程中去。 @Arun – jordan