I'm trying to construct an easy to use affiliate site, each post-type has a custom field where keywords can be entered per post. ( using advanced custom fields plugin )
Then in a template I call that field into a URL like this :
<?php if( get_field('amazon_keywords') ): ?> <a href="http://www.amazon.co.uk/s/?_encoding=UTF8&camp=1634&creative=19450&field-keywords=<?php the_field('amazon_keywords'); ?>&linkCode=ur2&tag=AFFID"> More info Test dynamic Amazon</a> <?php else : ?> Something else <?php endif; ?>
This works and displays the link with the entered keywords.
Because its an affiliate link, best practice would be to mask it. So instead of showing the affiliate link id like to show it something like :
Normally this is fine because I can just do a redirect, but the addition of the php inside the URL for the keywords is where I've stumbled.
Anyone have any ideas ?