Hi @eugenio2023
Troubleshooting the entry date issue falls out of the scope of this plugin support.
But that said, checking your page headers I found that the page is still being cached. If you have Fresh Forms still enabled, that would indication that you are using a embedding method not supported or that you don’t have a supported caching plugin installed.
Checking the source code for the page it seems that you are using SG Optimizer, which is supported, so it must be embedding method.
You can add the following snippet to your theme functions.php file to force Fresh Forms to run for that page:
add_filter( ‘freshforms_post_has_gform’, ‘fffg_fresh_these_posts’ );
function fffg_fresh_these_posts(){
// Force Fresh Forms to run for page id 38608.
return array( 38608 );
}
Would that function work for all new forms created on that page?
The cache exclusion is done per page ID, it doesn’t matter how many forms you have in the page.
By the way, I forgot to mention that after adding the snippet, you need to flush the host cache to allow the snippet to run.
When I put that function in the child theme’s function.php it gives me this error.
Warning: Use of undefined constant ‘freshforms_post_has_gform’ – assumed ‘‘freshforms_post_has_gform’’ (this will throw an Error in a future version of PHP) in /../../../../public_html/wp-content/themes/child-theme/functions.php on line 200
Warning: Use of undefined constant ‘fffg_fresh_these_posts’ – assumed ‘‘fffg_fresh_these_posts’’ (this will throw an Error in a future version of PHP) in /../../../../public_html/wp-content/themes/child-theme/functions.php on line 200
Warning: Cannot modify header information – headers already sent by (output started at /home/customer/www/laserum.pt/public_html/wp-content/themes/child-theme/functions.php:200) in /../../../../public_html/wp-content/mu-plugins/eos-deactivate-plugins.php on line 2184
It seems that the WordPress forum altered the quotes for the add_filter line, changing straight quotes to curly quotes. This time should be displayed with the correct quotes, replace the add_filter line with the one below:
add_filter( 'freshforms_post_has_gform', 'fffg_fresh_these_posts' );
Hey, Samuel. I have been observing if the inputs of the forms entered correctly, but it has not. If I don’t clean the Siteground cache, the entries continue to enter with the wrong date, that is, if today is 4, they enter with the date 3. Can you help me, please?
Hi Eugenio, the assistance in this support forum is limited to Fresh Forms features.
Have you added the snippet with the correct add_filter line and flushed the host cache after doing so as suggested?
Yes, I have followed the instructions as you suggested.
Do you have the SG Optimizer plugin enabled too? Note that this plugin must be enabled in order for Fresh Forms to be able to exclude the page from cache.
Yes, and I have cleared the cache from the Siteground server itself. I have checked if the Siteground cache works correctly and if it works.
We have two options at this point:
A) You can grant me access to a staging clone of your site to take a look.
B) You can just exclude the URL of your page from the host cache using the SG Optimizer plugin, see here. If the page is not excluded from cache using this method either, then you would need to reach your host support as this would indicate something is not working as expected between your host and the SG Optimizer plugin, which is designed to control your host cache.