1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<?php // Callbacks for adding AMP-related things to the main theme
add_action( 'wp_head', 'penci_amp_frontend_add_canonical',5 );
function penci_amp_frontend_add_canonical() { if ( false === apply_filters( 'penci_amp_frontend_show_canonical', true ) ) { return; }
$canonical_url = penci_amp_get_canonical_url(); $penci_amp_url = Penci_AMP_Link_Sanitizer::__pre_url ( $canonical_url );
printf( '<link rel="amphtml" href="%s"/>', esc_url( $penci_amp_url ) ); }
|