Search code examples
wordpressshortcodeelementor

Elementor says - "Sorry, the content area was not found in your page. " while using custom shortcode


I am using default theme of Elementor Plugin. Plugin is very nice but I am facing issue while using my custom shortcode in page. It shows “Sorry, the content area was not found in your page. You must call the_content function in the current template, in order for Elementor to work on this page.” [1]: https://i.sstatic.net/7xBHV.png

To solve this error, I have added <?php the_content(); ?> in my custom shortcode but it shows the same error. I have also tried by creating a custom template, but the result is same.

So please help me to solve this error. Any suggestions are acceptable.

Thanks in Advance


Solution

  • Probably your shortcode function changes the post query. try adding wp_reset_query(); before the function closes.