Change AMP Aspect Ratio
-
Hello,
All of the images are shown as squares in the AMP version of my site. I was wondering if it is possible to maintain the original aspect ratio of the images.
Having everything cropped to a square works for some images, but some are cropped in a less than ideal way.
Is there a way to keep the aspect ratio that the images have on my desktop site?
Thank you
The page I need help with: [log in to see the link]
-
It appears the issue is with images in galleries. I can see one example of that in https://www.seoulinspired.com/gsl-studio-starcraft-2/?amp as the
amp-img
is inside of anamp-carousel
, but there is only one image.I think I see the problem, and I think it has been fixed in the latest pre-release of the plugin. Please look over the description in this PR: https://github.com/ampproject/amp-wp/pull/2864
And then please test this latest pre-release: https://github.com/ampproject/amp-wp/releases/tag/1.2.1-beta1- This reply was modified 5 years, 3 months ago by Weston Ruter.
- This reply was modified 5 years, 3 months ago by Weston Ruter.
Correction: the PR is not in that 1.2.1-beta1 release. There is however a build amp.zip which is linked to on the PR: https://github.com/ampproject/amp-wp/pull/2864
Thank you for your reply!
I have installed the beta version but am still facing the issue. I looked at the example on Github but don’t really understand how I should implement the change.
(the example given under): Supply the attachment IDs in post_content such as the following (taking the place of 2715,2714):
should I implement that shortcode/HTML on every gallery?
I thought that fix would have solved your problem.
The code in the pull request there is only for testing purposes. You shouldn’t have to make any changes to how the gallery is embedded.
For that one image with the caption “Very few ever make it to the GSL Studio’s Hall of Fame!” how is it being added to the post? Can you share the underlying code in the
post_content
of the post? Is it agallery
shortcode? I’ll try to reproduce the problem once I know.The gallery is using the default WordPress shortcode – [gallery ids="3238"].
However, I am using a third party gallery plugin to change how my default WordPress galleries are displayed. The plug-in in question is Meow Gallery (https://www.ads-software.com/plugins/meow-gallery/).
Could a conflict/error be caused by that? I assumed that since it still used the default WordPress shortcode that it would be fine.
Thank you again for your help!
Hello,
I was just wondering if there has been any update for this?
Thank you!
@devitaliza I’ve tested the meow plugin also and I don’t see any problems using either single images or galleries.
Do you mind deactivating EWWW Image Optimizer before checking again? I can see this vertical image is being served from a related CDN. Maybe upload a new gallery, with a mix of images of all dimensions and we can test further. There are other validation errors on your site, which could be coming from a configuration setting or another plugin.
Feel free to share your Site Health info also, we might be able to notice something.
Hello James,
Thank you for the advice! You were right, the issue appears to come from EWWW. When I disable the plugin the images work correctly.
In regards to the validation errors and the site health, here is what I got:
### wp-core ### version: 5.2.2 site_language: en_US user_language: en_US permalink: /%postname%/ https_status: true user_registration: 0 default_comment_status: open multisite: false user_count: 22 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /home/seoulins/public_html wordpress_size: 3.82 GB (4097565712 bytes) uploads_path: /home/seoulins/public_html/wp-content/uploads uploads_size: 7.50 GB (8053439399 bytes) themes_path: /home/seoulins/public_html/wp-content/themes themes_size: 32.28 MB (33843863 bytes) plugins_path: /home/seoulins/public_html/wp-content/plugins plugins_size: 135.61 MB (142192586 bytes) database_size: 55.68 MB (58381201 bytes) total_size: 11.53 GB (12385422761 bytes) ### wp-dropins (1) ### advanced-cache.php: true ### wp-active-theme ### name: Neve version: 2.3.22 (latest version: 2.4.0) author: ThemeIsle author_website: https://themeisle.com parent_theme: none theme_features: hfg_support, title-tag, post-thumbnails, automatic-feed-links, custom-logo, html5, customize-selective-refresh-widgets, custom-background, themeisle-demo-import, align-wide, editor-color-palette, fl-theme-builder-headers, fl-theme-builder-footers, header-footer-elementor, lifterlms-sidebars, lifterlms, amp, menus, widgets theme_path: /home/seoulins/public_html/wp-content/themes/neve ### wp-themes (2) ### Ashe Pro: version: 3.5.3, author: Royal Flush GeneratePress: version: 2.3.2, author: Tom Usborne ### wp-plugins-active (20) ### Akismet Anti-Spam: version: 4.1.2, author: Automattic AMP: version: 1.2.0, author: AMP Project Contributors Autoptimize: version: 2.5.1, author: Frank Goossens (futtta) BackWPup: version: 3.6.10, author: Inpsyde GmbH Booking.com Product Helper: version: 1.0.0, author: Booking.com Broken Link Checker: version: 1.11.8, author: ManageWP CAOS: version: 2.5.0, author: Daan van den Bergh Classic Editor: version: 1.5, author: WordPress Contributors Hide Featured Image: version: 1.3.1, author: shahpranaf Meow Gallery Block: version: 3.4.9, author: Jordy Meow, Thomas Kim Ninja Forms: version: 3.4.18, author: The WP Ninjas Pre* Party Resource Hints: version: 1.5.8, author: Sam Perrow Rank Math SEO: version: 1.0.31, author: Rank Math Remove Orphan Shortcodes: version: 1.1, author: Meks Scriptless Social Sharing: version: 3.0.1, author: Robin Cornett SG Optimizer: version: 5.2.5, author: SiteGround Table of Contents Plus: version: 1601, author: Michael Tran TablePress: version: 1.9.2, author: Tobias B?thge Widget Options: version: 3.7.3, author: Phpbits Creative Studio WP Scraper: version: 5.4, author: Robert Macchi ### wp-plugins-inactive (4) ### EWWW Image Optimizer Cloud: version: 4.9.2, author: Exactly WWW Swift Performance: version: 2.1.1, author: SWTE Thrive Leads: version: 2.2.1.1, author: <a href="https://thrivethemes.com">Thrive Themes</a> Thrive Product Manager: version: 1.2.1, author: Thrive Themes ### wp-media ### image_editor: WP_Image_Editor_GD imagick_module_version: Not available imagemagick_version: Not available gd_version: bundled (2.1.0 compatible) ghostscript_version: 9.26 ### wp-server ### server_architecture: Linux 3.12.18-clouder0 x86_64 httpd_software: Apache php_version: 7.3.7 64bit php_sapi: cgi-fcgi max_input_variables: 1000 time_limit: 120 memory_limit: 768M max_input_time: 120 upload_max_size: 128M php_post_max_size: 128M curl_version: 7.59.0 OpenSSL/1.0.2r suhosin: false imagick_availability: false htaccess_extra_rules: true ### wp-database ### extension: mysqli server_version: 5.6.40-84.0-log client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $ ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /home/seoulins/public_html/wp-content WP_PLUGIN_DIR: /home/seoulins/public_html/wp-content/plugins WP_MAX_MEMORY_LIMIT: 768M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable
Also, in regards to the errors, according to Google they are:
Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.
The tag ‘noscript enclosure for boilerplate’ appears more than once in the document.
could these both be caused by a plugin?
My category pages are also getting an error:
Error in required structured data element
I understand you are busy and don’t expect everything to be solved. But if you could point me in the right direction I would be grateful!
Thank you
@devitaliza Thanks for the update, good to know.
After checking your site now I’m not seeing any validation errors. They might be coming from non stale search console results. Here’s how to request Google to re-crawl a URL.
- The topic ‘Change AMP Aspect Ratio’ is closed to new replies.