Amp-carousel of type carousel does not work in legacy paired mode?
-
My mode is legacy paired mode.No add add_theme_support(‘amp’);
And in my theme create new folder ‘amp’.Which contains cutomizer file template: meta-gallery-image.php,as follows:<?php global $product; if ( ! is_object( $product ) ) { $product = wc_get_product( get_the_ID() ); } $product_gallery_ids = $product->get_gallery_image_ids(); if ( empty( $product_gallery_ids ) ) { return; } ?> <amp-carousel id="amp-wp-carousel" class="amp-wp-carousel-with-carousel-preview" width="400" height="400" layout="responsive" type="slides" controls lightbox> <?php foreach ( $product_gallery_ids as $attachment_id ) : $originImage = wp_get_attachment_image_url( $attachment_id, 'full' ); $originImageAlt = trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ); ?> <amp-img src="<?php echo $originImage; ?>" width="400" height="400" layout="responsive" alt="<?php echo $originImageAlt; ?>"></amp-img> <?php endforeach; ?> </amp-carousel> <amp-carousel class="amp-wp-carousel-preview" width="auto" height="48" layout="fixed-height" type="carousel" controls> <?php foreach ( $product_gallery_ids as $attachment_index => $attachment_id ) : $thumbnailImage = wp_get_attachment_image_url( $attachment_id, 'thumbnail' ); $thumbnailImageAlt = trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ); ?> <button on="tap:amp-wp-carousel-with-carousel-preview.goToSlide(index=<?php echo $attachment_index; ?>)"> <amp-img src="<?php echo $thumbnailImage; ?>" width="60" height="40" layout="responsive" alt="<?php echo $thumbnailImageAlt; ?>"></amp-img> </button> <?php endforeach; ?> </amp-carousel>
type=”carousel” not working,Below is a (screenshot description)[https://user-images.githubusercontent.com/15621520/43236199-6d8e5320-90b6-11e8-9803-70b05aec0e85.png].
There are several questions in this picture.
Type is carousel amp-carousel does not work properly.
amp-lightbox-gallery script not normal working.
This is amp-lightbox-gallery:function trueniuAmpCustomizeComponentScripts( $data ) { $data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js'; $data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js'; $data['amp_component_scripts']['amp-social-share'] = 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js'; $data['amp_component_scripts']['amp-carousel'] = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js'; $data['amp_component_scripts']['amp-lightbox-gallery'] = 'https://cdn.ampproject.org/v0/amp-lightbox-gallery-0.1.js'; $data['amp_component_scripts']['amp-mustache'] = 'https://cdn.ampproject.org/v0/amp-mustache-0.1.js'; return $data; } add_action( 'amp_post_template_data', 'trueniuAmpCustomizeComponentScripts' );
Except for amp-lightbox-gallery, other scripts can load normally.
Is this a bug?Can you test it?
The page I need help with: [log in to see the link]
- The topic ‘Amp-carousel of type carousel does not work in legacy paired mode?’ is closed to new replies.