• vagu71

    (@vagu71)


    The plugin adds scripts based on the elements that are added to the pages using the page builder.

    So for example, lets assume that there is an accordion element added on the homepage of the website using the page builder, the plugin will add the accordion js to the homepage.

    Now, the issue is that say there is an accordion added to the header of the theme (not the page content) (the accordion markup is added to the header.php file in /wp-content/plugins/amp-theme-framework-master), in order to make this accordion work on the site, the accordion js script needs to be added on all pages (because the accordion would appear on each page as it’s in the header). Once this is done, the homepage shows an error, as there are duplicate accordion js files, one added by the plugin because there was an accordion added to the homepage content using page builder, and another was added manually because of the accordion in the header.php file.

    Is there a workaround that you’d suggest for this @ampforwp?

    Also, I believe that this might be a duplicate of the post https://ww.wp.xz.cn/support/topic/duplicate-amp-script-to-pages-that-you-want-to-show-amp-ads/. But couldn’t find an answer on that posts. And the post appears to be closed for new replies.

    • This topic was modified 7 years ago by vagu71.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Yes, You are right.

    I have created a ticket for this. https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/3257

    We will allow people to register scripts in a way that it works flawlessly without duplicating it.

    Thread Starter vagu71

    (@vagu71)

    thanks @ahmedkaludi!

    Thread Starter vagu71

    (@vagu71)

    @ahmedkaludi, by when do you reckon you’ll be adding this to the plugin code? This causes issues when the menu is implemented in the form of an accordion. On pages where there is an accordion in the content, duplicate script errors show up.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    This ticket is set as a medium priority for us so it will take some time before it comes out.

    But, Why do you have the menus in the form of the accordion?

    Can you share the link of the page you have built? perhaps there’s a tweak we can do to fix this temporarily.

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

The topic ‘Duplicate Scripts’ is closed to new replies.