I have a post featuring a product that I've created using advanced custom fields. I would like to have a link on the post that opens in a new window and displays the same product, just with a different look and info. (Note: I'm specifically looking to use a second template and not a different CSS because different info will be displayed on each template.) I've tried using the code below, but my custom template just returns a blank page. Can anyone suggest a fix?
Here's the link I'm using on the original template.
<a href="<?php the_permalink(); ?>?custom-template=1">Link</a>
Here's the code that I'm putting at the top of the custom template.
if ($_GET['custom-template'] == 1) { include custom-template.php; return; }
Thanks, John
