We can advise on how to customize the footer template, but it may be Monday before we get back to you.
At the same time, please provide more details on the fatal error you’re seeing in non-legacy template. We’d want to prevent that from happening.
Hi Weston,
thanks for your reply, I’ll wait for your instructions on monday. 🙂
Regarding the fatal error: I would like to send you the error code via PN or e-mail. Is there a way not to post it here in public?
Thanks!
Yes, please submit your site information via our private form: https://forms.gle/AXLsn3TNBjhLJxMK9
Thanks, I just sent you the requested information! 🙂
Best regards
@wpeight Thanks for sharing that. I can see the issue is that you have a plugin which is depending on a particular theme being active. The plugin isn’t doing a function_exists() check to make sure the function is defined.
I tried looking for the plugin’s source code on GitHub and it seems the most recent versions available do have the required function_exists() check, so maybe it’s just a matter of updating the plugin to the latest version.
Otherwise, what you can do is on the AMP settings screen, you can go down to the “Plugin Suppression” section and then switch the offending plugin from Active to Suppressed and hit Save. That will prevent the fatal error from occurring. Nevertheless, the underlying problem is the plugin has a bug in that it is not checking if the required function exists.
Do you mind if I mention here what the problematic plugin is?
Hi there, thanks for your investigation and the information! Sure, please mention the problematic plugin. 🙂 Did you see on GitHub, if that new version is final/rolled out? Because I use the latest version already.
Thanks!
The error is occurring in the gt3_wp_head_custom_code() function which is defined in the GT3 Themes Core plugin. There’s not an official copy of the plugin on GitHub, but I found someone else had posted the code: https://github.com/goldenlight-webdev999/pbs/blob/b09d4eac379fcca1af1a593a4521612cd2560ede/html/wp-content/plugins/gt3-themes-core/core/theme-adding-functions.php#L167-L175
To me it seems your version doesn’t have the function_exists('gt3_option') check.
It appears the theme/plugins are only distributed on ThemeForest so we can’t further advise as to specifics.
So you can try suppressing the GT3 Themes Core plugin, but I’m guessing this plugin is responsible for adding the footer you desire.
Hello @wpeight
To add links/info to the footer of legacy theme you can use amp_post_template_footer hook
You can use the following code in your themes functions.php file or in custom plugin
eg:
add_action( 'amp_post_template_footer', 'amp_custom_leagacy_footer' );
/**
* AMP Legacy Footer.
*
* @return void
*/
function amp_custom_leagacy_footer() {
?>
<div class="amp-wp-footer">
<div>
<a href="https://dogan.legal/impressum/"><?php echo esc_html_e( 'Imprint' ); ?></a> |
<a href="https://dogan.legal/datenschutzerklaerung/"><?php echo esc_html_e( 'Privacy', '' ); ?></a>
<?php echo sprintf( '© 2015 - %s', esc_html( gmdate( 'Y' ) ) ); ?> <?php esc_html_e( 'dogan.legal - Lawyer Okan Dogan', '' ); ?>
</div>
</div>
<?php
}
-
This reply was modified 5 years, 4 months ago by
Milind More.
Hi Milind,
I just tried your code and it worked like a charme! You are awesome, thank you!
Have a nice day!