You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AC1: Using “paired mode,” themes can specify an alternative path to use for AMP templates (see @westonruter’s comment proposed).
AC2: When themes do this, the templates in that directory will replace the entire “paired mode” template system in the plugin. The AMP toggle developed in 0.6 will continue to be available in this mode.
Tasks
Add theme support property to indicate path to paired-mode templates, for the theme root, where the template hierarchy will be evaluated. This may be called theme_root or template_directory or template_path or something else that makes the most sense.
And add callback function which is used to determine whether a given request should be routed to the paired mode. Have default logic that tries to identify the template for a given request and if it is is present, then make AMP available. Otherwise, don’t make it available. For example, if requesting a single page, but there is no page.php or index.php in the AMP template root, then AMP would not be available by default.
Update amp_prepare_render() to prevent calling add_action( 'template_redirect', 'amp_render' ); when current_theme_supports( 'amp' ), as we need to not use amp_render() since it uses the old paired-mode theme system; instead, this function should do whatever is required (e.g. add template_include filter), per the next task (implement template hierarchy).
Implement the same template hierarchy resolution logic, ideally re-use what is in core. Figure out how to make use of the custom theme root for AMP templates.
Continue outputting the AMP rel link in head for non-AMP templates and other things that happen in current paired mode. And also include relevant links in head for AMP templates. Toggle what is output in wp_head based on whether it is an AMP response or not.
The text was updated successfully, but these errors were encountered:
Acceptance Criteria
AC1: Using “paired mode,” themes can specify an alternative path to use for AMP templates (see @westonruter’s comment proposed).
AC2: When themes do this, the templates in that directory will replace the entire “paired mode” template system in the plugin. The AMP toggle developed in 0.6 will continue to be available in this mode.
Tasks
theme_root
ortemplate_directory
ortemplate_path
or something else that makes the most sense.amp_prepare_render()
to prevent callingadd_action( 'template_redirect', 'amp_render' );
whencurrent_theme_supports( 'amp' )
, as we need to not useamp_render()
since it uses the old paired-mode theme system; instead, this function should do whatever is required (e.g. addtemplate_include
filter), per the next task (implement template hierarchy).The text was updated successfully, but these errors were encountered: