Support » Plugin: Elementor Page Builder » Issue using apply_filters for the_content

  • ProgressionStudios

    (@progressionstudios)


    I am having an issue while using apply_filters in a post. When opening the frontend page builder, it displays the page builder in the wrong section since my apply_filters is at the top of the post page.

    Code in question: <?php echo apply_filters(‘the_content’ $example_video); ?>
    Since the above code appears before the normal <? the_content(); ?> call, it causes the page builder to render in the wrong spot (at the top).

    Is there a snippet of code that I can add so the editor skips the apply_filters the_content? Or possibly is there a snippet of code for if the frontend editor is open, to just not render that area. That would work as an alternative.

    The reason I don’t add a custom filter to apply_filters is that I’m using locally hosted videos which don’t output when using custom filters.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Mati Horovitz

    (@mati1000)

    Hi, You shouldn’t use the the_content filter manually/twice in the page.

    For embeding a video URL you should use something like this:
    <?php echo wp_oembed_get( $video_url ) ?>

    ProgressionStudios

    (@progressionstudios)

    Thanks for the quick reply! Unfortunately the wp_oembed_get doesn’t work with locally hosted videos. Therefore I’m stuck using the apply_filters as it is a key part of the theme.

    Is there anyway to check if the frontend editor is open and to skip a bit of code? A simple if statement would be great and work as an alternative.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue using apply_filters for the_content’ is closed to new replies.