با عرض سلام خدمت کاربران محترم سایت پی وی لرن.
با جلسه ای دیگر از سری جلسات دوره جامع آموزش ساخت قالب وردپرس در خدمت شما هستیم.
در این جلسه قصد داریم به معرفی فایل Style.css قالب های وردپرسی بپردازیم.
تمام قالب هایی که برای وردپرس طاحی میشوند، باید فایل Style.css را داشته باشند.
این فایل نمایش (طراحی بصری) صفحات سایت شما را کنترل میکند.
برای اینکه وردپرس مجموعه Template file های قالب را به عنوان یک قالب معتبر شناسایی کند، فایل style.css باید در دایرکتوری اصلی قالب قرار بگیرد.
وردپرس از هدر کامنت فایل style.css برای نمایش اطلاعات قالب در پنل داشبورد استفاده میکند.
مثال:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /* Theme Name: Twenty Seventeen Theme URI: https://wordpress.org/themes/twentyseventeen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device. Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: twentyseventeen Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready 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. */ |
در بخش زیر قسمت های مختلف کامنت بالا را توضیح میدهیم: (مورد هایی که با * مشخص شده اند، برای قالب ضروری هستند)
بعد از کامنت هدر، فایل style.css میتواند شامل هرگونه کد css ای باشد.
اگر قالب شما یک Child Theme است، مشخصه Template نیز باید وجود داشته باشد.
این مشخصه نام قالب والد را مشخص میکند.
جلسه معرفی فایل style.css نیز به پایان رسید.
در جلسه بعد به معرفی انواع پست ها (Post Types) خواهیم پرداخت.