Home  >  Q&A  >  body text

Polylang for WordPress: pll_e function breaks HTML

<p>I am using Polylang and loco Translation to translate my blog site. I'm adding the string translations manually and this works fine with the get_theme_mod part, but there is one place where I also want to add a custom string translation and after I add it manually it breaks the html and the css won't work. </p> <p>Added custom string translation should look like this; no need for pll_e to work properly</p> <p>But after I added pll_e to that section in index.html;</p> <p> <pre class="brush:html;toolbar:false;"><?php get_header(); ?> <div class="content"> <?php if ( get_theme_mod('heading-enable','on') == 'on' ) : ?> <?php echo get_template_part(pll_e ('inc/page-title') ); ?> <?php endif; ?></pre> </p> <p>It breaks the html but the translation works. It looks like this; it looks like this</p> <p>Does anyone know a solution? I think it has something to do with get_template_part and get_theme_mod since the same thing I did with the get_theme_mod part worked fine. </p> <p>By the way, there is a difference between having pll_e and not having pll_e. </p> <p>No pll_e with pll_e</p>
P粉158473780P粉158473780416 days ago528

reply all(1)I'll reply

  • 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-->

    reply
    0
  • Cancelreply