Site logo

Archived topic

Need help adding the_content function into the page template's code

13 replies · Started by Joe on March 4, 2020

Viewing posts 1–14 of 14

I'm using the Generatepress child theme with the Elementor Pro page builder.

The problem I'm having, is when I try to create a popup template opt in form in Elementor, it shows this:

"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."

It says to add this:

<?php the_content(); ?>

Can you help me with where to add this?

Thank you,
Joe

Hi there,

can you run us through the steps you're taking to create the Pop up ?
e.g is it from the Dashboard > Elementor or within a published Page.

Hi David,

Sure, in my Wordpress dashboard using the Elementor Pro plugin, I go to templates. Then I can create and save templates. I have some currently that I can use and edit no problem.

It'll let you create and save them in different ways. One of the ways to save as a template is as a popup, which is what I'm trying to do for an opt in form.

But when I try to create it, it just says:

“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.”

Then it offers this as a solution:

https://docs.elementor.com/article/56-content-area-not-found

<?php the_content(); ?>

I'm just not sure where to put it.

Thank you for any help,
Joe

GP automatically adds the_content() function to the theme templates.
And i just tried the method you prescribe on a test site and it worked.

Just to be clear:

1. Elementor > Templates > Add New
2. Select Pop Up from Drop Down
3. Gave Template a name
4. Clicked Create Template
5. Editor opened ok - added some stuff and saved etc.

So in the Elementor troubleshooting doc:
https://docs.elementor.com/article/56-content-area-not-found

Can you try some of the steps under:

Does this happen on all pages, using any theme? If so, here are some reasons this might be occurring:

The odd thing is, is I contacted my hosting provider about this problem, and after they looked at it, it worked. So I thanked them for their help.

But the next day it seemed to go back to the same problem:

“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.”

Then after hearing back from you, it's working again.

I'm not sure why sometimes it works, and sometimes it doesn't?

I guess I'll see what happens.

Thank you for your help,
Joe

Two main things i have come across in the past:

1. Caches
Whether they be Plugin or Server side. If you can keep them disabled when building all the better.

2. PHP Memory - the more the merrier - i generally set mine to a minimum of 256meg.

It's not working again.

I checked my PHP Memory and it's over 700.

I disable the cache.

I even tried to create another popup opt in, and it still says content not found.

It's probably something simple, I just wish I could figure out what it is.

Thank you again for trying to help.

All i can suggest is running through that list of possible issues in the Elementor docs.

Also try using a Private/Incognito browser to eliminate browser caching causing a problem.

Hi David,

Thank you again for trying to help.

The problem seems to be device related.

For some reason, my laptop at home always gives the content not found message, but my desktop at work always seems to work.

I'm not sure why that is?

I know it's nothing related to Generatepress.

Thanks again for your help.

Joe

Disable any browser extensions you have to see if they are conflicting.
And then try in an incognito/private browser as the cache can cause issues.

Hi David,

I appreciate the reply's.

I've tried the incognito, and it still doesn't work.

I haven't tried disabling any browser extensions, I'll try that.

I have tried other browsers though that didn't have any browser extensions, and it still doesn't work.

I'll try disabling my Chrome browser extensions.

Thanks again,

Joe

May be worth trying another network - routers and ISP's also cache pages, which may be throwing an error.

Hi David,

With all the latest updates, it's now working properly.

Thank you for your help,

Joe

Glad to hear that !

This archived topic is closed to new replies.