-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_post_featured_image() runs unnecessarily #732
Comments
It would be helpful to be able to filter this i.e. |
How are you turning off a featured image from being displayed? Are you doing something like: add_filter( 'amp_post_template_data', function( $data ) {
$data['featured_image'] = false;
return $data;
} ); If so, then it would seem to me that the scripts returned by |
We have a metabox with a checkbox titled "Show image on article page." When the box is not checked, we save some postmeta to indicate suppression. In the template itself, we retrieve the value of the postmeta, put it in
In the
|
This should be made obsolete by #2202 in that we can move to constructing the Reader mode templates in a more traditional way, and then only the AMP components that are actually used in the page will then be among the scripts included on the page. |
Fixed by #3781. Now only the required component scripts are included on the rendered page, as needed. |
build_post_featured_image()
runs unnecessarily, whether or not the featured image is shown in the template.We have postmeta that determines whether to hide/show the image.
Result: if the featured image is a gif,
amp-anim
gets added toamp_component_scripts
, which generates a warning in the AMP validator.The text was updated successfully, but these errors were encountered: