• Resolved T4G

    (@tips4gamers)


    Hi,

    The Floating Button plugin is compatible with AMP but not the Legacy theme since the plugin uses the wp_footer() action to work.

    “This (Legacy Theme) hasn’t the action ‘wp_footer’ and it is a problem.
    Plugin ‘Floating Button’ uses the action ‘wp_footer’ for work” – Floating Button developers.

    I was wondering if I create an amp-footer.php file in the amp folder housed in my staging site folder and add the wp_footer function to that file, would the Floating Button plugin work?

    Or is there much more to it than that?

    Thanks and regards.

    • This topic was modified 3 years ago by T4G. Reason: Added Quote
Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter T4G

    (@tips4gamers)

    UPDATE:

    It’s not “my staging site”, I meant my child theme.

    So I added amp/templates/footer.php in my child theme and copied what the AMP plugin has in that file to the new footer.php.

    I tested a few options out trying to include wp_footer() but I must be doing something wrong.

    James Osborne

    (@jamesosborne)

    Hi there @tips4gamers,

    Can you try the below snippet, replacing the shortcode ID with your own shortcode as given from within the Floating Buttons settings?

    add_action(
    	'amp_post_template_footer',
    	function() {
            echo do_shortcode('[Floating-Button id="1"]');  
    	}
    );

    You can add this snippet to your child themes functions.php file. Let me know how that goes.

    We’ll also look see how the Floating Buttons plugin works with AMP and see if we can propose an update.

    Thread Starter T4G

    (@tips4gamers)

    Hi @jamesosborne,

    Thank you for that! It worked for the most part. The Main button pops up perfectly.

    However, Sub Button 1 (Menu) will not populate after I click on the Main button.

    I am going to run more tests on a staging site as to why that is. I want to make sure nothing is interfering with it.

    Thank you for that code! I do appreciate your help.

    I will update this when I am finished diagnosing.

    Here is a page it is located on if you would like to look at it – https://www.tips4gamers.com/how-to-relocate-in-madden-22-a-complete-guide/?amp=1

    Thanks and regards

    Thread Starter T4G

    (@tips4gamers)

    UPDATE:

    So I did some testing and I may have found a bug in the menu element. I alerted the developers about this issue.

    The main button will populate just fine on AMP, however, when I click on the Main Button, the WP navigation menu element will not pop up as you can see in this screenshot – https://prnt.sc/1yaoqlz

    1. I have deactivated every plugin besides Floating Button Pro and AMP.
    2. I then changed themes to the default WP theme, which is compatible with AMP in Transitional or Standard.
    3. I changed back to our Pro theme and chose a different theme than the Legacy Theme.

    All of the above troubleshooting steps did nothing different from each other. The navigation menu will not populate and it behaves the same way across all of the troubleshooting steps I took.

    So I believe the code you gave me works fine but it looks like there may be an issue with the Floating Button menu element.

    James Osborne

    (@jamesosborne)

    Thanks for sharing your testing results. If you’re encountering the same when using different themes then it’s possible that this will have to be addressed on within the Floating Button side. I will however check this, so please so allow some time before we check this out. We’ll report back to you at some stage over the next few days if that’s ok.

    Thread Starter T4G

    (@tips4gamers)

    No problem, that’s absolutely fine, do what you need to do. I appreciate the help.

    I let them know about the issue as well. They stated:

    It’s a problem with the plugin.
    The option ‘Item Type’ works with the javascript and menu open via javascript.
    The AMP remove javascript from the site.

    I am not sure if they plan on fixing this at all, I would assume so. I am sure it is possible with AMP to do since AMP has its own JS library.

    Correct me if I am wrong but it could be something similar to Weston Ruter’s AMP Reader Nav Menu?

    The developers at Wow are definitely skilled and do great work so I am sure they would be able to fix it with no issues.

    James Osborne

    (@jamesosborne)

    Appreciate the update. You may be correct that this may be addressed with some changes to the plugin using amp-bind, which is indeed used in Weston’s Reader Nav Menu plugin. We will however need to take a look and review this in order to propose any solution.

    We’ll keep you updated here once we review the sub menu toggles.

    James Osborne

    (@jamesosborne)

    @tips4gamers Just to let you know that if you update to the latest version of Floating Button (5.1.1) this has been addressed, with our team proposing a quick fix based on your support topic. Thanks for raising this.

    If you have any further queries be sure to reach out. And if you’ve been using the AMP plugin for some time we’d love if you shared your thoughts so far.

    Thread Starter T4G

    (@tips4gamers)

    Thank you for that, I appreciate it.

    I have a support ticket open with them, but I haven’t heard back from them for about 7 days or so. I tried replying to that support ticket giving them an update and seeing if this is something they can fix but I have not heard back from them. So thank you for the help.

    I did see the release notes and the main button worked, however, the navigation menu still will not populate – https://prnt.sc/1z5wndx. I do not expect you all to fix this issue or dive any deeper as it would be more of a custom development type thing on your end so I will mark this as resolved.

    I will try to reach out to Wow-Company again.

    I will most definitely share my thoughts.

    Thanks again for the help!

    James Osborne

    (@jamesosborne)

    @tips4gamers Thanks for the update. We’ll also take a look at this and see what we can determine. Should we be able to suggest or propose any update we’ll let you know here.

    James Osborne

    (@jamesosborne)

    @tips4gamers Just to let you know I’ve just tested a floating buttons setup like your own. With that do you have any other sites with which you can test a similar setup with?

    Thread Starter T4G

    (@tips4gamers)

    @jamesosborne thank you for that. I will go ahead and set up a local WP environment and test it out then report back with what I found.

    Thread Starter T4G

    (@tips4gamers)

    Hi @jamesosborne,

    So I tested Floating Button Pro on a fresh WordPress install and the issue is still there. The navigation menu will not populate.

    The print, link, log in, log out, register, lost password, and share work fine on the AMP Transitional (Twenty Twenty-One theme) and the Legacy theme. The translate icon does not even populate and menu, scroll to top, scroll to bottom, go back, and go forward do not work at all.

    That is the testing I have done. Floating Button Lite is compatible with AMP as it states on your amp-wp ecosystem/plugins/ website but a lot of the added features Floating Button Pro (paid version) has is not.

    Everything works just fine on the desktop version of the site.

    Best regards.

    James Osborne

    (@jamesosborne)

    Many thanks for the update. While I didn’t test the paid version I will check this with the team. I would expect there may be some functionality that may not be AMP compatible, in particular if there is any custom JavaScript output on AMP URLs.

    James Osborne

    (@jamesosborne)

    @tips4gamers Thanks for your patience on this. I’ve tested out the demo of the pro version of Floating buttons and there are various features that don’t seem AMP compatible, primarily due to the use of custom JavaScript. As it’s a commercial plugin I haven’t been able to test this out in full however if you’re able to provide some insights into any of the validation errors output you can reach out to the plugin developer and enquire about full compatibility plans for the pro version.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘wp_footer() needed for Floating Button Compatibility’ is closed to new replies.