2016-12-04 9 views
0

私は私がコンテンツと私を翻訳するためにWordPress用Qtranslateプラグインを使用しています、各言語Qtranslateカスタムフォント毎の言語の問題

あたりのカスタムフォントファミリを設定したいクライアントのためのワードプレスのウェブサイトで問題に直面していますこれに成功しました...私もコードのCSS変更を適用するWordPressのカスタムCSSと呼ばれるプラグインを使用して

問題は私がコードを使用してカスタムフォントを設定..それは両方の言語のカスタムフォントを設定します。 。これを修正するために親切に助けてください

私のカスタムCSSコードは

です
@font-face { 
font-family: GEDinarOne-Medium; 
src: url('http://www.example.com/wp-content/themes/fonts/GEDinarOne-Medium.ttf'); 
font-weight: normal;} 

:lang(ar) body, h1, h2, h3, h4, h5, h6, p, blockquote, li, a{ 
    font-family: GEDinarOne-Medium !important; 
    } 

答えて

0

あなたはCSSクラスとあなたのCSSの下で場所、それを作成してから、翻訳されたコンテンツのタグに追加する必要があります。

たとえば、

@font-face { 
 
    font-family: 'Yrsa'; 
 
    font-style: normal; 
 
    font-weight: 400; 
 
    src: local('Yrsa'), local('Yrsa-Regular'), url(https://fonts.gstatic.com/s/yrsa/v1/HvXbkSMs7hgg2r-HiCNOmA.woff2) format('woff2'); 
 
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 
 
} 
 
@font-face { 
 
    font-family: 'Indie Flower'; 
 
    font-style: normal; 
 
    font-weight: 400; 
 
    src: local('Indie Flower'), local('IndieFlower'), url(https://fonts.gstatic.com/s/indieflower/v8/10JVD_humAd5zP2yrFqw6ugdm0LZdjqr5-oayXSOefg.woff2) format('woff2'); 
 
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 
 
} 
 
body { 
 
    background: #111; 
 
    color: #999; 
 
    text-align: justify; 
 
    text-justify: inter-word; 
 
    max-width: 80%; 
 
    margin: 10% 
 
} 
 
body, 
 
h1, 
 
h2, 
 
h3, 
 
h4, 
 
h5, 
 
h6, 
 
p, 
 
blockquote, 
 
li, 
 
a { 
 
    font-family: 'Yrsa'; 
 
} 
 
.otherlanguage { 
 
    font-family: 'Indie Flower'; 
 
}
<body> 
 
    <div> 
 
    <h1>This is a Header 1 in font A</h1> 
 
    <h1 class="otherlanguage">This is a Header 1 in font B</h1> 
 
    <h2>This is a Header 2 in font A</h2> 
 
    <h2 class="otherlanguage">This is a Header 2 in font B</h2> 
 
    <h3>This is a Header 2 in font A</h3> 
 
    <h3 class="otherlanguage">This is a Header 2 in font B</h3> 
 
    <p>This is a paragraph using font A 
 
     <br>Lorem ipsum dolor sit amet, in eam simul nostrud definiebas, mea iusto placerat prodesset ei. Eum summo audiam ea. Vitae aperiri at duo. Vis atomorum partiendo id, nam ea noluisse platonem. Nec minimum consequat cu, pri in harum moderatius. Ferri 
 
     aperiam forensibus an nam.</p> 
 
    <p class="otherlanguage">This is a paragraph using font B 
 
     <br>Lorem ipsum dolor sit amet, in eam simul nostrud definiebas, mea iusto placerat prodesset ei. Eum summo audiam ea. Vitae aperiri at duo. Vis atomorum partiendo id, nam ea noluisse platonem. Nec minimum consequat cu, pri in harum moderatius. Ferri 
 
     aperiam forensibus an nam.</p> 
 
    </div> 
 
</body>


編集:新しいスニペット

私はセレクタを組み合わせ良い方法があると確信しているが、これはいずれも変更せずに動作するはずですHTML。

@font-face { 
 
    font-family: 'Yrsa'; 
 
    font-style: normal; 
 
    font-weight: 400; 
 
    src: local('Yrsa'), local('Yrsa-Regular'), url(https://fonts.gstatic.com/s/yrsa/v1/HvXbkSMs7hgg2r-HiCNOmA.woff2) format('woff2'); 
 
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 
 
} 
 
@font-face { 
 
    font-family: 'Indie Flower'; 
 
    font-style: normal; 
 
    font-weight: 400; 
 
    src: local('Indie Flower'), local('IndieFlower'), url(https://fonts.gstatic.com/s/indieflower/v8/10JVD_humAd5zP2yrFqw6ugdm0LZdjqr5-oayXSOefg.woff2) format('woff2'); 
 
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 
 
} 
 
.page-id-70 h1, 
 
.page-id-70 h2, 
 
.page-id-70 h3, 
 
.page-id-70 h3, 
 
.page-id-70 h4, 
 
{ 
 
    font-family: 'Yrsa'; 
 
} 
 
.page-id-71 h1, 
 
.page-id-71 h2, 
 
.page-id-71 h3, 
 
.page-id-71 h3, 
 
.page-id-71 h4, 
 
{ 
 
    font-family: 'Indie Flower'; 
 
}

+0

私はワードプレスで体要素へのアクセスを持っていないので、非常に...それがこの方法を動作しません:)感謝ます。..応答のためにどうもありがとうございました。カスタムCSSプラグインを使用して変更を加える –

+0

何か特別な理由はありますか? –

+0

ません...それは私が各ワードプレスのページのHTML構造にアクセスすることができないだけという –