• Resolved madeforbrowser

    (@madeforbrowser)


    Hi, if use custom fields and apply the_content-filter to them, all translations break and the main page content is shown instead of the field content. Can u help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author sbouey

    (@sbouey)

    Hi,

    Do you use ACF custom fields ?
    if in it you use the_content() it will probably make an infinite look
    can you use the get_the_content() filter. in this case it’s not passed to Falang

    Stéphane

    Thread Starter madeforbrowser

    (@madeforbrowser)

    Hi yes, i i now know, that it is caused by the_content filter. If i use the_excerpt as filter, it works as expected and returns html. the get_the_content filter works, too, but the html is broken..

    Plugin Author sbouey

    (@sbouey)

    The get_the_content is not filtered by Falang , do you know why it’s broken ?
    you can contact me directly too (faboba.com contact form)

    Thread Starter madeforbrowser

    (@madeforbrowser)

    broken is a big word, i is just not returned as html. (The ul and li-Elements are not present) but the content is correctly returned.

    Plugin Author sbouey

    (@sbouey)

    The problem was due to the loop for this display

     $menschen = get_posts(array('post_type'=>'mensch','posts_per_page'=>1000,'post_status'=>'publish'));
      foreach($menschen as $mensch):
    ....
     endforeach;
    

    the filter the_content load the global post

    you have to do this

    
    $menschen = get_posts(array('post_type'=>'mensch','posts_per_page'=>1000,'post_status'=>'publish'));
      foreach($menschen as $mensch):
    
       global $post;
       $post = get_post($mensch->ID);
       setup_postdata($post);
    .....
    .....
     wp_reset_postdata();
    endforeach;
    

    Best regards,
    Stéphane

    Thread Starter madeforbrowser

    (@madeforbrowser)

    Thank’s a lot. now it works exactly as expected 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘apply_filter’ is closed to new replies.