Style.css thành phần tối thiểu mẫu WordPress

Style.css thành phần tối thiểu mẫu WordPress

Style.css là file CSS chính trong một WordPress theme. Bạn cũng có thể tạo nhiều style sheet khác,nhưng file
style.css luôn tồn tại. Đặc tính quan trọng nhất của file style.css là nó nắm giữ tất cả meta data cho theme của
bạn. Chúng được thiết lập trong header của file style.css trong comments sử dụng các tên thuộc tính, cái wordpress
sẽ cho ra đầu ra trong theme manager.Sau đây là các comments từ Twenty Twelve style.css header:

 

/*
Theme Name: Twenty Twelve
Theme URI: http://wordpress.org/extend/themes/twentytwelve
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any
device. Features include a front page template with its own widgets, an optional display font,
styling for post formats on both index and single views, and an optional no-sidebar page template.
Make it yours with a custom menu, header image, and background.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, gray, white, one-column, two-columns, right-sidebar, flexible-width, custom-background,
custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template,
microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
Text Domain: twentytwelve
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.
*/

 

Còn đây là hướng dẫn nhanh về các thông tin bạn có thể thiết lập trong style.css header:
+ Tên theme (theme name): Tiêu đề đầy đủ của theme, bao gồm cả khoảng trắng, nó thể được viết hoa.
+ Theme URI: Vị trí bạn có thể tìm thấy để download theme.
+ Author URI: website của tác giả.
+ Description: Mô tả ngắn về đặc điểm và thiết kế của theme.
+ Version: Phiên bản của theme khi bạn làm việc trên nó.
+ Lisense: Bản đăng kí theme sử dụng.
+ Lisense URI: Địa chỉ web trong đó bạn có thể tìm nhiều thông tin hơn về lisense.
+ Tags: Một danh sách các tags phù hợp,cái có thể được sử dụng để giúp người dùng tìm theme trong wordpress
repository.
+ Text domain: Một cái nhận dạng duy nhất cho sử dụng trong việc xác định vị trí trong WordPress. Cái này
thường là phiên bản chữ thường (không có dấu cách) của tên theme của bạn.
Bất cứ chú thích thêm vào về theme cũng có thể được thêm vào cuối của comments của style.css. Không phải bất
cứ thông tin meta nào cũng yêu cầu bắt buộc cho theme.

Chia sẻ

Leave a Reply

Your email address will not be published. Required fields are marked *