• Resolved Tyke79

    (@tyke79)


    Good afternoon,

    Because I don’t know how to correct the amount of technical errors that appear in order to validate the urls in AMP.

    Many of the bugs are caused by third party plugins. I also have to add, that many webs are not displayed correctly (there are text blocks that disappear, contact forms that are not displayed, etc…)

    I guess there are a lot of people in the same situation as me.

    I throw a couple of questions:

    Is there a possibility to add a section to edit and layout the content for the AMP version of the pages and posts?

    In my website I use visual composer for desktop, but for AMP I would like to layout the content with Gutenberg.

    The following plugin and in the premium version: https://es.www.ads-software.com/plugins/wp-amp-lite/ allows the option to display and layout different content for the desktop version and another for AMP. It also supports Gutenberg.

    Could you consider adding this option?

    Attached screenshot: https://prnt.sc/ubkigd

    Greetings

    • This topic was modified 4 years, 2 months ago by Tyke79.
    • This topic was modified 4 years, 2 months ago by Tyke79.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Wouldn’t that require you to maintain two separate versions of the content? If you make a change in one you’d have to make the corresponding change in the other. Is that worth it?

    Thread Starter Tyke79

    (@tyke79)

    Hello Weston,

    Thank you for responding, on that I agree with you completely.

    In my case, I use Visual composer on all my websites. I know that it is not compatible with AMP or at least gives a lot of problems for the content to be displayed correctly and the url to be validated by AMP validator.

    My suggestion is to be able to layout with Gutenberg for AMP, because I can’t find the way to display the webs correctly with Visual composer

    Plugin Author Weston Ruter

    (@westonruter)

    So if you are able to turn off AMP for pages built with Visual Composer then that would also be a solution?

    Plugin Author Weston Ruter

    (@westonruter)

    This plugin code should automatically disable AMP on posts & pages built with Visual Composer:

    add_filter( 'amp_skip_post', function ( $skip, $post_id, WP_Post $post ) {
    	if ( false !== strpos( $post->post_content, '[vc_row' ) ) {
    		$skip = true;
    	}
    	return $skip;
    }, 10, 3 );

    The detection logic I used here comes from https://stackoverflow.com/a/36352452/93579

    There may be a more current way of detecting whether VC is used, however.

    Thread Starter Tyke79

    (@tyke79)

    That’s an option I already use.

    The thing is, there are many pages relevant to SEO effects where I do want to show the AMP version.

    All the pages are laid out with Visual Composer

    But it is displayed wrong or not validated.

    I pass you an example url: https://bit.ly/3gVch49

    • This reply was modified 4 years, 2 months ago by Tyke79.
    Plugin Author Weston Ruter

    (@westonruter)

    Yes, the broken AMP pages coming from Visual Composer are to be expected. This is because Visual Composer does not have fallbacks in place for when JavaScript is turned off. You can see that your non-AMP pages area also broken if you turn off JavaScript in your browser.

    Nevertheless, I have an idea for an approach that may work for you to create mirror AMP content. I’ll try it out and share what I come up with.

    Thread Starter Tyke79

    (@tyke79)

    Mr. Weston, you are very kind. I will be waiting.

    Thanks a lot

    Plugin Author Weston Ruter

    (@westonruter)

    @tyke79 Here you go: https://gist.github.com/westonruter/56e96c7a9eacf51d0db256b00c46f002

    See comments below for installation instructions and example usage.

    This isn’t the recommended way to use the AMP plugin, but if it’s the only option you have, then I suppose it can be better than nothing.

    Thread Starter Tyke79

    (@tyke79)

    Hello Weston,

    I have tried the plugin and I must thank you because it works correctly

    This is a good temporary solution.

    Do you think it will be added or integrated into the official plugin?

    Plugin Author Weston Ruter

    (@westonruter)

    No, this won’t be added to the official AMP plugin. I’m glad it works for you, but it’s not an approach that we want people to use in general.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Visual editor for AMP’ is closed to new replies.