ホームページ  >  に質問  >  本文

Polylang for WordPress: pll_e 関数が HTML を破壊する

<p>私はブログ サイトを翻訳するために Polylang と loco Translation を使用しています。文字列翻訳を手動で追加しています。これは get_theme_mod 部分では問題なく機能しますが、カスタム文字列翻訳も追加したい場所が 1 か所あり、それを手動で追加すると HTML が破損し、CSS が機能しなくなります。 </p> <p>追加されたカスタム文字列変換は次のようになります。pll_e が適切に動作する必要はありません</p> <p>しかし、index.html のそのセクションに pll_e を追加した後;</p> <p> <pre class="brush:html;toolbar:false;"><?php get_header(); ?> <div class="コンテンツ"> <?php if ( get_theme_mod('Heading-enable','on') == 'on' ) : ?> <?php echo get_template_part(pll_e ('inc/page-title') ); ?> <?php endif; ?></pre> </p> <p>HTML は壊れますが、翻訳は機能します。こんな感じです; こんな感じです</p> <p>誰か解決策を知っていますか? get_template_part 部分と get_theme_mod 部分で行ったのと同じことがうまく機能したため、これは get_template_part と get_theme_mod に関係があると思います。 </p> <p>ちなみに、pll_eがあるのとないのでは違いがあります。 </p> <p>いいえ pll_e pll_e</p> を使用
P粉158473780P粉158473780416日前533

全員に返信(1)返信します

  • P粉418214279

    P粉4182142792023-08-31 14:51:03

    i solved the problem by editing index.html like this ;

    <div class="content">
    
    <div class="page-title group">
    <div class="page-title-inner group">
    
                    <?php if ( get_theme_mod('heading-enable','on') == 'on' ) : ?>
        <h2> <?php echo get_template_part(pll_e('inc/page-title') ); ?>  </h2>
    
    <?php endif; ?>
        
                                
    </div><!--/.page-title-inner-->

    返事
    0
  • キャンセル返事