This file contains hidden or 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 | |
/** | |
* Add a custom AMP template file. | |
* | |
* Registers templates in a /templates subdirectory. | |
* | |
* @filter amp_post_template_file | |
* | |
* @param string $file The file name input. | |
* @param string $type The type of template. |
This file contains hidden or 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 | |
/** | |
* Add custom AMP template files. | |
* | |
* Registers templates in a /templates subdirectory. | |
* | |
* @filter amp_post_template_file | |
* | |
* @param string $file The file name input. | |
* @param string $type The type of template. |
This file contains hidden or 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 | |
/** | |
* Show an Admin Notice if the AMP plugin is not found. | |
* | |
* This is a basic implementation. Naturally, you'll want | |
* to add ajax support so that once this is dismissed, it goes | |
* away permanently. Also, you may want to limit the admin | |
* pages this displays to prevent annoying your users. | |
* | |
* @return bool |
This file contains hidden or 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'; |
This file contains hidden or 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 | |
/** | |
* Strip out all shortcode content. | |
* | |
* This is a quick and dirty way | |
* to ensure no shortcodes introduce | |
* invalid markup into an amp template. | |
* | |
* @param string $content WP Post content. | |
* |
This file contains hidden or 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 | |
/** | |
* Allow custom actions in our AMP template. | |
*/ | |
function jr3_amp_add_custom_actions() { | |
add_filter( 'the_content', 'jr3_amp_add_featured_image' ); | |
} | |
add_action( 'pre_amp_render_post', 'jr3_amp_add_custom_actions' ); | |
/** |
This file contains hidden or 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 | |
/** | |
* Slightly modified version of the default WP AMP stylesheet, style.php. | |
* | |
* This is pared down for clarity. | |
* | |
* @link https://github.com/Automattic/amp-wp/blob/master/templates/style.php | |
*/ | |
?> | |
/* Merriweather fonts */ |
This file contains hidden or 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
server { | |
listen 80; | |
listen 443 ssl; | |
server_name local-www.network.rogersradio.ca local-www.kiss925.com local-www.sonic1029.com local-www.jackfm.com; | |
root /srv/www/musicradio/build/webroot; | |
include /etc/nginx/nginx-wp-common.conf; | |
} |