• Resolved WPEight

    (@wpeight)


    Hi there,

    in germany we need on every page a link on our imprint and our data privacy informations. I use your legacy template in reade mode (because the other templates cause a fatal error) and I wonder how I can edit the footer of the /amp Version of my blogposts in order to add links on my imprint and my data pricacy informations.

    thanks for your help and keep up the good work!

    best regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    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.

    Thread Starter WPEight

    (@wpeight)

    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!

    Plugin Author Weston Ruter

    (@westonruter)

    Yes, please submit your site information via our private form: https://forms.gle/AXLsn3TNBjhLJxMK9

    Thread Starter WPEight

    (@wpeight)

    Thanks, I just sent you the requested information! 🙂
    Best regards

    Plugin Author Weston Ruter

    (@westonruter)

    @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?

    Thread Starter WPEight

    (@wpeight)

    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!

    Plugin Author Weston Ruter

    (@westonruter)

    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.

    Plugin Support Milind More

    (@milindmore22)

    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( '&copy; 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.
    Thread Starter WPEight

    (@wpeight)

    Hi Milind,

    I just tried your code and it worked like a charme! You are awesome, thank you!

    Have a nice day!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Edit amp page footer’ is closed to new replies.