Override HTML Tags
-
Hello there!
First of all, thank you for the great plugin and the great documentation.
I’m using read mode, legacy template and would like to know if I can override the head HTML attribute of the AMP post somehow using php.
There is an optimisation plugin that is adding a little JavaScript on AMP pages (I already created a ticket with them, but also wanted to know if I can manage this with php).
For example, given the following document:
<!DOCTYPE html> <html amp transformed="self;v=1" i-amphtml-layout="" i-amphtml-no-boilerplate=""> <head><script FOO>undesired js</script> <meta charset="utf-8"><meta name="viewport" content="width=device-width,minimum-scale=1"><link rel="preconnect" href="https://cdn.ampproject.org"><style amp-runtime="" i-amphtml-version="012201141909003"> …Is is possible to do something like this using some available AMP function to remove the undesired js?
<?php $html = file_get_contents(URL); $content = preg_replace('/<script FOO>.*<\/script>', '', $html); return $new_content ?>Or any other way to remove it using php? Any ideia is highly appreciated 🙂
Thanks
The page I need help with: [log in to see the link]
The topic ‘Override HTML Tags’ is closed to new replies.