سجاد سیدی
1 سال پیش توسط سجاد سیدی مطرح شد
5 پاسخ

ویرایش فایل style.css برای تغییر فونت

سلام
من توی پوشه قالب وردپرسم، یه پوشه به نام fonts ساختم.
بعد توش سه فایل BYekan.ttf، BYekan.woff و BYekan.eot رو قرار دادم.
فایل style.css قالب در حالت عادی به اینصورته:

/*
Theme Name: Twenty Twenty-Three
Theme URI: https://wordpress.org/themes/twentytwentythree
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Three is designed to take advantage of the new design tools introduced in WordPress 6.1. With a clean, blank base as a starting point, this default theme includes ten diverse style variations created by members of the WordPress community. Whether you want to build a complex or incredibly simple website, you can do it quickly and intuitively through the bundled styles or dive into creation and full customization yourself.
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 5.6
Version: 1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: twentytwentythree
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, accessibility-ready, blog, portfolio, news
*/

من بار اول به اینصورت تغییرش دادم:

@font-face {
    font-family: 'BYekan';
    src: url('fonts/BYekan.eot?#') format('eot'),
    url('fonts/BYekan.woff') format('woff'), 
    url('fonts/BYekan.ttf') format('truetype');
}
body{
        font-family:BYekan;
}
h1{
        font-family:BYekan;
}
h2{
        font-family:BYekan;
}
h3{
        font-family:BYekan;
}
h4{
        font-family:BYekan;
}
h5{
        font-family:BYekan;
}
h6{
        font-family:BYekan;
}
a{
        font-family:BYekan;
}
p{
        font-family:BYekan;
}
li{
        font-family:BYekan;
}
/*
Theme Name: Twenty Twenty-Three
Theme URI: https://wordpress.org/themes/twentytwentythree
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Three is designed to take advantage of the new design tools introduced in WordPress 6.1. With a clean, blank base as a starting point, this default theme includes ten diverse style variations created by members of the WordPress community. Whether you want to build a complex or incredibly simple website, you can do it quickly and intuitively through the bundled styles or dive into creation and full customization yourself.
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 5.6
Version: 1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: twentytwentythree
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, accessibility-ready, blog, portfolio, news
*/

و در بار دوم به اینصورت تغییرش دادم:

@font-face {
    font-family: 'BYekan';
    src: url('fonts/BYekan.eot?#') format('eot'),
    url('fonts/BYekan.woff') format('woff'), 
    url('fonts/BYekan.ttf') format('truetype');
}
body,h1,h2,h3,h4,h5,h6,a,p,li{
        font-family:BYekan;
}
/*
Theme Name: Twenty Twenty-Three
Theme URI: https://wordpress.org/themes/twentytwentythree
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Three is designed to take advantage of the new design tools introduced in WordPress 6.1. With a clean, blank base as a starting point, this default theme includes ten diverse style variations created by members of the WordPress community. Whether you want to build a complex or incredibly simple website, you can do it quickly and intuitively through the bundled styles or dive into creation and full customization yourself.
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 5.6
Version: 1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: twentytwentythree
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, accessibility-ready, blog, portfolio, news
*/

انتظار داشتم تمام سایت فونتش BYekan بشه ولی هر بار هیچ اتفاقس نیفتاد و هیچ جا فونتش تغییر نکرد!
ممنون از کمکتون


ثبت پرسش جدید
رایموند
تخصص : مختصص وردپرس - برنامه نویس لار...
@Raymond 1 سال پیش مطرح شد
0

درود خوبی...
همین body کافی است که به همه صفحات فونت اعمال شود:

body{
        font-family:BYekan;
}

بقیه نیاز نیست...


سجاد سیدی
@sajjad.seyedi 1 سال پیش آپدیت شد
0

سلام
بازم درست نشد!
من از قالب ۲۰۲۳ وردپرس استفاده میکنم


رایموند
تخصص : مختصص وردپرس - برنامه نویس لار...
@Raymond 1 سال پیش مطرح شد
0

@sajjad.seyedi
کش مرورگر خالی کردید؟
۲. در fonts/ کنارش دو تا نقطه بزار ../fonts/


oss_vahid
تخصص : wp developer
@ossvahid 1 سال پیش مطرح شد
0

سلام اگه فونت نمیاد احتمالا علتش اینکه ادرس دهی درستی ندادید

اگه میخاید فونت روی همه قسمت و تگ ها اعمال بشه باید از این استفاده کنید

*
{
font-family:BYekan;
} 

MPB
تخصص : Front-end developer
@MPBCoder 1 سال پیش آپدیت شد
0

سلام وقت بخیر ..،
به این صورت عوضش کنین ببینین درست میشه؟
درضمن کش هم پاک کنین

/*
Theme Name: Twenty Twenty-Three
Theme URI: https://wordpress.org/themes/twentytwentythree
Author: the WordPress team
Author URI: https://wordpress.org
Description: Twenty Twenty-Three is designed to take advantage of the new design tools introduced in WordPress 6.1. With a clean, blank base as a starting point, this default theme includes ten diverse style variations created by members of the WordPress community. Whether you want to build a complex or incredibly simple website, you can do it quickly and intuitively through the bundled styles or dive into creation and full customization yourself.
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 5.6
Version: 1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: twentytwentythree
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, accessibility-ready, blog, portfolio, news
*/
@font-face {
    font-family: 'BYekan';
    src: url('fonts/BYekan.eot?#') format('eot'),
    url('fonts/BYekan.woff') format('woff'), 
    url('fonts/BYekan.ttf') format('truetype');
}
*:not(code,kbd){
        font-family: "BYekan"  !important;
}

برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام