Generate pages from url params
-
Hi,
I’m struggling with the following problem I’m trying to develop. Maybe it’s something small I’m overlooking, maybe it’s impossible all together. Not sure. Here goes…
We’ve created a set of qr codes. Each qr code links to a url in the form of domain.com/?key=12345. The idea is that if the qr code is scanned, a browser window opens up with that domain; not a big issue so far.
Now, those url’s don’t have existing pages related to them. Those pages should be generated ‘on the go’ and should use a custom build template. The idea here is that if the url parameter ‘key’ equals 12345, use custom template and populate it with data related to 12345. That key parameter could be any number: 12345, 52345, 14235, etc.Building custom templates and populate them with dynamic content (through WP ACF, api or whatever) isn’t a problem for me. The problem is how do I generate the pages the qr code should open up? And how do I grab the related content the key parameter refers to?
I did google a lot for this and one thing that kept popping up was url-rewrites in combination with custom posttypes. Tried this, but didn’t seem to get it to work. At least not for the issue at hand.
I hope the explanation of the issue is clear and someone could guide me in the right direction.
- The topic ‘Generate pages from url params’ is closed to new replies.