Last active
September 28, 2016 16:03
-
-
Save johnregan3/84df6666467744e6159efdc8524bc0ab to your computer and use it in GitHub Desktop.
Add component scripts to WP AMP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Register the amp-sidebar and amp-accordion component scripts with WP AMP. | |
* | |
* This goes in your amp.php | |
*/ | |
function jr3_amp_component_scripts( $data ) { | |
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js'; | |
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js'; | |
return $data; | |
} | |
add_filter( 'amp_post_template_data', 'jr3_amp_component_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment