Support » Plugin: Elementor Page Builder » Elementor Editor not working when shortcode is present on page…

  • Resolved VERYA

    (@veryaca)


    I have this odd behavior on my website… Maybe I’m missing something, who knows, but I’ve been pulling my hair since late PM on this, and it’s killing me, haha 🙂

    I have many pages which I can edit without any issues in WP using Elementor. However, as soon as I add a “Shortcode” element to any page, it now shows the infamous “The Content Area Was Not Found in Your Page” when I try to edit it again (even though it was just fine before I added that shortcode).

    I switched to TwentyNineteen and everything works just fine, but I noticed under that theme that the shortcode is not “processed” under Elementor (normal, since it’s part of my theme). So I have three questions:

    1. Any way I can disable shortcode rendering in Elementor, in the backend? Seems like the shortcode content is causing that issue…

    2. Could it be because my shortcode is not echoing the content, but using ob_start() and ob_get_clean()? Because a simple echo shortcode works just fine.

    3. Could it be because my shortcode is using get_posts()?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Seems like I found my issue… At some point, my shortcode uses the following:

    global $post;
    $post = $p;
    setup_postdata($post);

    I’m assuming it is not allowed? So instead of using functions like the_title(), the_permalink(), etc. in my code, I am now using echo get_the_title($p->ID) and such which seems to have fixed my issue.

    But I’d be curious as to why this is causing me a headache?

    Plugin Support davidr90

    (@davidr90)

    I am glad you have managed to find a solution to this.

    If you have a code-related question, please send it to our repo,
    with a detailed description.
    https://github.com/elementor/elementor

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.