forked from ampproject/amp-wp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-start.php
72 lines (69 loc) · 2.17 KB
/
html-start.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* HTML start template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<!doctype html>
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
<?php
// Note: The following two <style> tags are combined into <style amp-custom> via AMP_Style_Sanitizer.
// Splitting up the styles into two stylesheets allows for plugin-supplied styles via the amp_post_template_css action
// to be excluded from the styles in the style template part, which are more important given they style the overall page.
/**
* Fires when rendering <head> in Reader mode templates.
*
* @since 0.2
*
* @param AMP_Post_Template $this
*/
do_action( 'amp_post_template_head', $this );
?>
<style class="style-template-part">
<?php $this->load_parts( [ 'style' ] ); ?>
</style>
<style class="amp-post-template-css-action">
<?php
/**
* Fires when printing CSS styles in Reader mode templates.
*
* Callbacks should print bare CSS without any `<style>` or `<link>` tags.
* As an alternative to using this, please consider:
*
* add_action( 'amp_post_template_head', function() { wp_print_styles( 'foo' ); } );
*
* @since 0.3
*
* @param AMP_Post_Template $this
*/
do_action( 'amp_post_template_css', $this );
?>
</style>
</head>
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">
<?php
/**
* Fires immediately after printing the <body>.
*
* @since 1.2.1
* @see wp_body_open()
*
* @param AMP_Post_Template $this
*/
do_action( 'amp_post_template_body_open', $this );