How to Add amphtml tag Automatically?


Dear Blogger, I have run an Entertainment Blog . recently i have decided to make my blog AMP version. But Can’t. After searching web i came to know about amphtml tag have to use for non AMP site. So i have create sub-domain . and sub-domain blog is Fully AMP validated. According to AMP rules, I have used amphtml tag on my non amp site (i.e the code is:

And in AMP site (i.e. I have used following tag

Problem is i have put this code manually & Only index page are mentioned. But i want all post will put in tag automatically. For Example: In Non-AMP site ( the tag will be:

And in AMP site ( the tag will be:

Anyone can help me regarding this??