Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jhultqvist

    (@jhultqvist)

    I’ll suggest an answer to my own question and see if anyone “in the know” can verify it.

    Would it work to just add the code in “single.php”, in the <head> section?

    Thanks
    Jesper

    Plugin Author Weston Ruter

    (@westonruter)

    If you’re using the theme templates which are bundled with the AMP plugin, then you can add custom code to your AMP head via the amp_post_template_head action.

    For example, in your theme’s functions.php you can add:

    add_action( 'amp_post_template_head', function() {
    	?>
    	<!-- SOME CUSTOM AMP HEAD CODE -->
    	<?php
    } );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add code to Head on AMP pages’ is closed to new replies.