[AMP] How to convert img tag from footer to amp-img ?

Posted in: Newspaper
Post count: 24

Dear,
Google search console warn me that all my articles own in their footer an img tag instead of amp-img tag
So I would like to convert the line


<div class="td-sub-footer-copy">
   © Be'Art Magazine
   <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">
      <img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" />
   </a>
   <br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.            
</div>

To


<div class="td-sub-footer-copy">
   © Be'Art Magazine
   <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">
      <amp-img width="88px" height="31px" alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" />
   </a>
   <br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.            
</div>

img tag is replaced by amp-img and I added the followings attributes: amp-img width=”88px” height=”31px”

How to do it ?
should I use a:
– javascript code ?
– php code ?

The footer text was set from theme panel -> footer
footer

Thanks for your help

Post count: 23312

Hi,

Unfortunately, the theme has not been designed for this case, sorry! Also, you can try adding the following code in footer.php in amp core files, like this ->
https://www.screencast.com/t/hKKPDGHgw

$buffy .= td_sanitize_image(stripcslashes($td_footer_text) );

The result is here -> https://www.screencast.com/t/zQt2HlMObMR

Thanks.

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