“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.”
Elementor works as expected on all other pages.
]]>I am having a problem where WPSSO keeps creating an error message every 1 second in my debug.log file, this leads to oversized log files. The first time I found this error the log was about 12GBs big. I would like to disable logging in WPSSO, but I wasnt able to find the setting for it in WordPress. It would be great if someone could tell me where this setting can be found.
In the meantime, I will continue trying to solve the issue, I identified it has to do most likely with Elementor, but until the issue can be fixed I would really like to disable logging, as it is killing my site.
2024-08-12 09:56:18WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.613 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:19WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.027 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:20WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.030 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:21WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.033 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:22WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.024 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:23WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.024 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:24WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.050 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:25WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.037 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:26WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.060 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 09:56:27WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.063 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:19:59WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.622 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:20:02WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.062 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:20:03WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.055 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:20:05WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.004 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:57:52WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.663 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:57:59WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.027 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:59:02WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.677 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:59:06WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.006 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 10:59:11WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.016 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:09:58WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.611 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:09:59WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.002 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:01WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.145 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:01WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.786 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:02WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.405 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:02WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.564 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:05WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.074 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:06WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.613 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:16WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.732 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:18WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.008 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:20WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.015 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:24WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.010 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).2024-08-12 11:10:25WpssoUtil::safe_apply_filters warning: Slow filter hook(s) detected – WordPress took 1.025 secs to execute the “the_content” filter (longer than recommended max of 1.000 secs).
Thanks for any answers and assistance, I greatly appreciate your time!
]]>Problem: the_content is running multiples times, which might cause the ad code to appear more than once.
Advanced Ads uses the outer call to the_content
only which fixes the problem automatically in most cases. Please reach out here if you don’t see any ads at all because of this feature.
We even installed Elementor, rolled back and re-updated plugin still can not edit home page. Yes all other pages work just home page. Even tried to manually add the_content fuction code in php.
Please help us, this is pure craziness after all the work on this site. Theme is fine as was been since Monday when we installed it.
]]>the_content
filter or add an additional new filter in shouldDisplay()
which allows returning false
there based on our own custom logic?
Currently function contentDisplay
is running at every single post/page display and sometimes causes general server overload issues when it looks for available forms and markup in database even though the output is never required/used on our site.
versiculo uses the single-versiculo.php template and I can see the posts display the links. The single-versiculo.php uses this line to display the content:
<?php echo apply_filters('the_content', get_the_content()); ?>
capitulo uses the single-capitulo.php template. It uses this line to display the content:
echo apply_filters('the_content', get_the_content());
But there are no links displayed. I can’t see the difference and I’m turning myself crazy with this.
Besides, in single-capitulo.php I also retrieve versiculos, because there are a one to many relationship among capitulos and versiculos. Because performance, I use a direct call to the database to retrieve the content from wp_posts ($versiculo->ver_contenido). Then I use this line to display the post:
$filtered_content = substr(apply_filters('the_content', $versiculo->ver_contenido), 3, -5);
printf('<div class="versiculo-item " style="background-color:var(%s)"><b style="color:purple">%s</b> %s</div>', $alternateColor, $versiculo->ver_num_versiculo, $filtered_content );
Despite the use of apply_filters with the_content filter, I can’t see any link in my page.
The CPT Capitulos is also added to the whitelist. What may be wrong?
<div class="container">
<h1>HEADING</h1>
<p>PARAGRAPH 1</p>
(Custom widget area with three Bootstrap cards side-by-side...for the sake of space, I'm not including the code)
<p>PARAGRAPH 2</p>
</div>
Ideally, I would like to hard-code the div and the h1 into the page.php template file, call a custom widget area in page.php (utilizing dynamic_sidebar()), and use the_content() in page.php to display paragraph 1 and 2 from the content entered in the WordPress Dashboard.
Here is where I run into a problem. In page.php, I would have the following code (slightly simplified, but this is the gist of it):
<div class="container">
<h1>HEADING</h1>
<?php the_content(); ?>
<?php dynamic_sidebar( 'card_widget_area' ); ?>
</div>
I want paragraph 1 to be before the sidebar and paragraph 2 to be after the sidebar, yet, when I utilize the_content(), I get both paragraphs before the sidebar. Similarly, if I were to call the_content() after the sidebar, both paragraphs would display instead of only the second paragraph as desired. Is there a way to display only one of the paragraphs at a time using the_content() template tag? And can you use the_content() template tag more than once in a single template file?
Perhaps I am missing something or making things far more confusing than they need to be. Any help would be greatly appreciated!
]]>Is there a way to determine if the query is on the last loop? I tried wrapping my the_content filter in a loop_end action, but I believe this is too late — maybe I am wrong.
Here’s how the action and filter look right now.
add_action('loop_end', function(){
add_filter('the_content', function ($content){
static $i = 1;
$content .= "<h2>This has looped {$i} times</h2>";
$i++;
return $content;
}, 99);
}, 0);
]]>It looks something like this currently:
add_filter('the_content', function($content){
if(in_the_loop()){
$deepl_api_key = $_SERVER['DEEPL_API_KEY'];
$translator = new \DeepL\Translator($deepl_api_key);
$content_translated = $translator->translateText($content, 'EN', 'ES', ['tag_handling' => 'html'] );
return $content_translated;
}
return $content;
}, 99);
It’s working great especially on our blogs. However, I have a content block that makes a WP_Query for posts in a featured content section. Whenever this block is included in the the content, the translation services API throws an error saying the argument must be a string.
As you can see, I gave this hook a priority of 99, which to me would mean the content at this point would be nothing but HTML. In fact, when I print $content from within this hook, it renders the content as it’s suppose to.
My questions are:
Am I correct in assuming the content is pure HTML at the point that this filter is called?
To debug, is there a final step I can hook into where not only the content but headers, nav and footer have been compiled to an html file that I can then run through this translation service?
I realize this could be a bug with the translation API or even the custom theme, but I am trying out all of my theories.
The site is running WP v5.4 and a custom theme built on Sage 9x
]]>