Got a wordpress blog with tons of posts fully built by custom fields.
I'm now working on header.php file
I'm building a javascript including a window.open url containing the mentioned custom fields.
This url is so long, and is going to be repeated over 20 times within the script.
I'm then looking for a way to define the the whole url within a single string $long_url within the header.php file (I can't use goo.gl or bit.ly etc. for obvious reasons, since the url calls custom fields)
So, current script says...
window.open
http://website.com/?value1=<?php echo get_post_meta($post->ID, 'value1', true); ?>&value2=<?php echo get_post_meta($post->ID, 'value2', true); ?>&value3=etc...
I want to replace the mentioned url with a single string...
window.open
$long_url
How can I do this?