AMP tags getting modified automatically

Posted in: Newspaper
Post count: 46

Hello,

For a temporary experiment, we want to wrap out entire content with a <amp> tag

Editing /wp-content/plugins/td-composer/mobile/functions.php

using filter for the_content.

		if ( is_amp_endpoint() ) {
			
			$content = '<amp-script layout="container" src="https://s3-us-west-2.amazonaws.com/CCCCC.js" integrity="sha384-0Mv7fcjUICCCCH96v1oPH129fXHoID2Vfjk" crossorigin="anonymous">'.$content.'</amp-script>';
		}

It is changing it to

<amp-script layout="container" src="https://s3-us-west-2.amazonaws.com/CCCCC.js" class="i-amphtml-layout-container" i-amphtml-layout="container">

  • This topic was modified 5 years by valuewalk.
Post count: 18283

Hello !

Please note that this is considered custom work which is not covered by the Newspaper Support team. For this we recommend you to firstly create a backup and see how it works.

Thank you !

Post count: 46

Asking a question about “why” your theme changes the default wordpress the_content amp filter is custom work?

( This would work if I were on twentytwenty for example, which is a default wordpress theme. Your theme is doing something which is modifying it )

I’m not asking “how” to add tags to an amp page.

Taking a backup would help how? We take hourly backup because of the size of our website.

Post count: 35449

Hi valuewalk,

So the problem is that after you set the code in theme files this is change there in theme code or in page source? please provide me some more details to can make some investigations (to can replay on my install) and help you.

Thank you for your understanding!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.