A
A
apptimeru2017-02-14 14:11:33
Accelerated Mobile Pages
apptimeru, 2017-02-14 14:11:33

CNC in Wordpress for AMP pages?

Hello, I decided to attach AMP pages to Wordpress myself without various plugins, I already figured out how to implement everything, but I got stuck on one thing, how to add an arbitrary CNC to existing posts.
For example, I want a page like domain.ru/name to also open with the url domain.ru/name/amp and, accordingly, return the amp variable. I googled about the CNC, I know about add_rewrite_tag (), and about the fact that with it you can make as many variables as you like on an arbitrary page, but I don’t understand how to adapt this function for ordinary posts.
Please tell me where to dig, how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ommunist, 2017-02-16
@ommunist

Well, the official AMP plugin from Automattic somehow implements this, look in the plugin code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question